<!DOCTYPE html>
<html lang="zh-CN">
  <head>
  <meta charset="UTF-8">
  <meta 
    name="viewport"
    content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
  <meta 
    http-equiv="X-UA-Compatible" 
    content="ie=edge">
  <meta 
    name="theme-color" 
    content="#fff" 
    id="theme-color">
  <meta 
    name="description" 
    content="hexoDemo用于介绍如何使用hexo">
  <link 
    rel="icon" 
    href="/">
  <title>07-HTML标签图文详解（二）</title>
  
    
      <meta 
        property="og:title" 
        content="07-HTML标签图文详解（二）">
    
    
      <meta 
        property="og:url" 
        content="https://zwl5670.gitee.io/2001/01/01/01-HTML/07-html%E6%A0%87%E7%AD%BE%E5%9B%BE%E6%96%87%E8%AF%A6%E8%A7%A3%EF%BC%88%E4%BA%8C%EF%BC%89/index.html">
    
    
      <meta 
        property="og:img" 
        content="https://img.songhn.com/img/Y67gdd.png">
    
    
      <meta 
        property="og:img" 
        content="hexoDemo用于介绍如何使用hexo">
    
    
      <meta 
        property="og:type" 
        content="article">
      <meta 
        property="og:article:published_time" 
        content="2001-01-01">
      <meta 
        property="og:article:modified_time" 
        content="2023-03-14">
      <meta 
        property="og:article:author" 
        content="zwl5670">
      
        
          <meta 
            property="og:article:tag" 
            content="HTML">
        
      
    
  
  
  <link rel="preload" href="//at.alicdn.com/t/font_1946621_i1kgafibvw.css" as="style" >
  <link rel="preload" href="//at.alicdn.com/t/font_1952792_89b4ac4k4up.css" as="style" >
  <link rel="preload" href="/css/main.css" as="style" >
  
  <link rel="modulepreload" href="//instant.page/5.1.0">
  
  <link rel="stylesheet" href="/css/main.css">
  
  <link rel="stylesheet" href="//at.alicdn.com/t/font_1946621_i1kgafibvw.css">
  
  <link rel="stylesheet" href="//at.alicdn.com/t/font_1952792_89b4ac4k4up.css">
  
  
  
    <link rel="stylesheet" href="/js/lib/lightbox/baguetteBox.min.css">
  
  <script>
    function loadScript(url, cb) {
      var script = document.createElement('script');
      script.src = url;
      if (cb) script.onload = cb;
      script.async = true;
      document.body.appendChild(script);
    }
    function loadCSS(href, data, attr) {
      var sheet = document.createElement('link');
      sheet.ref = 'stylesheet';
      sheet.href = href;
      sheet.dataset[data] = attr;
      document.head.appendChild(sheet);
    }
    function changeCSS(cssFile, data, attr) {
      var oldlink = document.querySelector(data);
      var newlink = document.createElement("link");
      newlink.setAttribute("rel", "stylesheet");
      newlink.setAttribute("href", cssFile);
      newlink.dataset.prism = attr;
      document.head.replaceChild(newlink, oldlink);
    }
  </script>
  
    
  
  <script>
    // control reverse button
    var reverseDarkList = {
      dark: 'light',
      light: 'dark'
    };
    var themeColor = {
      dark: '#1c1c1e',
      light: '#fff'
    }
    // get the data of css prefers-color-scheme
    var getCssMediaQuery = function() {
      return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
    };
    // reverse current darkmode setting function
    var reverseDarkModeSetting = function() {
      var setting = localStorage.getItem('user-color-scheme');
      if(reverseDarkList[setting]) {
        setting = reverseDarkList[setting];
      } else if(setting === null) {
        setting = reverseDarkList[getCssMediaQuery()];
      } else {
        return;
      }
      localStorage.setItem('user-color-scheme', setting);
      return setting;
    };
    // apply current darkmode setting
  </script>
  
    <script>
      var setDarkmode = function(mode) {
      var setting = mode || localStorage.getItem('user-color-scheme');
      if(setting === getCssMediaQuery()) {
        document.documentElement.removeAttribute('data-user-color-scheme');
        localStorage.removeItem('user-color-scheme');
        document.getElementById('theme-color').content = themeColor[setting];
        document.getElementById('theme-color').dataset.mode = setting;
      } else if(reverseDarkList[setting]) {
        document.documentElement.setAttribute('data-user-color-scheme', setting);
        document.getElementById('theme-color').content = themeColor[setting];
        document.getElementById('theme-color').dataset.mode = setting;
      } else {
        document.documentElement.removeAttribute('data-user-color-scheme');
        localStorage.removeItem('user-color-scheme');
        document.getElementById('theme-color').content = themeColor[getCssMediaQuery()];
        document.getElementById('theme-color').dataset.mode = getCssMediaQuery();
      }
    };
    setDarkmode();
    </script>
  
  
  
    <link rel="preload" href="/js/lib/lightbox/baguetteBox.min.js" as="script">
    <link rel="preload" href="/js/lib/lightbox/baguetteBox.min.css" as="style" >
  
  
    <link rel="preload" href="/js/lib/lozad.min.js" as="script">
  
  
  
  
  
  
<meta name="generator" content="Hexo 6.3.0"></head>

  <body>
    <div class="wrapper">
       
      <nav class="navbar">
  <div class="navbar-logo">
    <a class="navbar-logo-main" href="/">
      
      <span class="navbar-logo-dsc">前端面试</span>
      </a>
  </div>
  <div class="navbar-menu">
    
      <a 
        href="/" 
        class="navbar-menu-item">
        
          首页
        
      </a>
    
      <a 
        href="/archives" 
        class="navbar-menu-item">
        
          归档
        
      </a>
    
      <a 
        href="/tags" 
        class="navbar-menu-item">
        
          标签
        
      </a>
    
      <a 
        href="/categories" 
        class="navbar-menu-item">
        
          分类
        
      </a>
    
      <a 
        href="/about" 
        class="navbar-menu-item">
        
          关于
        
      </a>
    
      <a 
        href="/links" 
        class="navbar-menu-item">
        
          友链
        
      </a>
    
    <button 
      class="navbar-menu-item darknavbar navbar-menu-btn" 
      aria-label="Toggle dark mode"
      id="dark">
      <i class="iconfont icon-weather"></i>
    </button>
    <button 
      class="navbar-menu-item searchnavbar navbar-menu-btn" 
      aria-label="Toggle search"
      id="search">
      <!-- <i 
        class="iconfont icon-search" 
        style="font-size: 1.2rem; font-weight: 400;">
      </i> -->
      <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img"
        class="iconify iconify--ion" width="28" height="28" preserveAspectRatio="xMidYMid meet" viewBox="0 0 512 512">
        <path fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="28"
          d="M256 80a176 176 0 1 0 176 176A176 176 0 0 0 256 80Z"></path>
        <path fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="28"
          d="M232 160a72 72 0 1 0 72 72a72 72 0 0 0-72-72Z"></path>
        <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="28"
          d="M283.64 283.64L336 336"></path>
      </svg>
    </button>
  </div>
</nav> 
      
      <div 
        id="local-search" 
        style="display: none">
        <input
          class="navbar-menu-item"
          id="search-input"
          placeholder="请输入搜索内容..." />
        <div id="search-content"></div>
      </div>
      
      <div class="section-wrap">
        <div class="container">
          <div class="columns">
            <aside class="left-column">
              
              <div class="card card-author">
                
  <img 
    src="https://img.songhn.com/img/Y67gdd.png" 
    class="author-img"
    width="88"
    height="88"
    alt="author avatar">

<p class="author-name">zwl5670</p>
<p class="author-description">前端学习资料</p>
<div class="author-message">
  <a 
    class="author-posts-count" 
    href="/archives">
    <span>215</span>
    <span>文章</span>
  </a>
  <a 
    class="author-categories-count" 
    href="/categories">
    <span>14</span>
    <span>分类</span>
  </a>
  <a 
    class="author-tags-count" 
    href="/tags">
    <span>14</span>
    <span>标签</span>
  </a>
</div>

              </div>
               <div class="sticky-tablet">
  
  
    <article class="display-when-two-columns spacer">
      <div class="card card-content toc-card">
        <div class="toc-header">
  <i 
    class="iconfont icon-menu" 
    style="padding-right: 2px;">
  </i>目录
</div>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%9C%AC%E6%96%87%E4%B8%BB%E8%A6%81%E5%86%85%E5%AE%B9"><span class="toc-text">本文主要内容</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%88%97%E8%A1%A8%E6%A0%87%E7%AD%BE"><span class="toc-text">列表标签</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1%E3%80%81%E6%97%A0%E5%BA%8F%E5%88%97%E8%A1%A8-lt-ul-gt-%EF%BC%8C%E6%97%A0%E5%BA%8F%E5%88%97%E8%A1%A8%E4%B8%AD%E7%9A%84%E6%AF%8F%E4%B8%80%E9%A1%B9%E6%98%AF-lt-li-gt"><span class="toc-text">1、无序列表&lt;ul&gt;，无序列表中的每一项是&lt;li&gt;</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#ul%E6%A0%87%E7%AD%BE%E5%AE%9E%E9%99%85%E5%BA%94%E7%94%A8%E5%9C%BA%E6%99%AF%EF%BC%9A"><span class="toc-text">ul标签实际应用场景：</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2%E3%80%81%E6%9C%89%E5%BA%8F%E5%88%97%E8%A1%A8-lt-ol-gt-%EF%BC%8C%E9%87%8C%E9%9D%A2%E7%9A%84%E6%AF%8F%E4%B8%80%E9%A1%B9%E6%98%AF-lt-li-gt"><span class="toc-text">2、有序列表&lt;ol&gt;，里面的每一项是&lt;li&gt;</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3%E3%80%81%E5%AE%9A%E4%B9%89%E5%88%97%E8%A1%A8-lt-dl-gt"><span class="toc-text">3、定义列表&lt;dl&gt;</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%A1%A8%E6%A0%BC%E6%A0%87%E7%AD%BE"><span class="toc-text">表格标签</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-tr-gt-%EF%BC%9A%E8%A1%8C"><span class="toc-text">&lt;tr&gt;：行</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-td-gt-%EF%BC%9A%E5%8D%95%E5%85%83%E6%A0%BC"><span class="toc-text">&lt;td&gt;：单元格</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8D%95%E5%85%83%E6%A0%BC%E7%9A%84%E5%90%88%E5%B9%B6"><span class="toc-text">单元格的合并</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-th-gt-%EF%BC%9A%E5%8A%A0%E7%B2%97%E7%9A%84%E5%8D%95%E5%85%83%E6%A0%BC%E3%80%82%E7%9B%B8%E5%BD%93%E4%BA%8E-lt-td-gt-lt-b-gt"><span class="toc-text">&lt;th&gt;：加粗的单元格。相当于&lt;td&gt; + &lt;b&gt;</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-caption-gt-%EF%BC%9A%E8%A1%A8%E6%A0%BC%E7%9A%84%E6%A0%87%E9%A2%98%E3%80%82%E4%BD%BF%E7%94%A8%E6%97%B6%E5%92%8Ctr%E6%A0%87%E7%AD%BE%E5%B9%B6%E5%88%97"><span class="toc-text">&lt;caption&gt;：表格的标题。使用时和tr标签并列</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%A1%A8%E6%A0%BC%E7%9A%84-lt-thead-gt-%E6%A0%87%E7%AD%BE%E3%80%81-lt-tbody-gt-%E6%A0%87%E7%AD%BE%E3%80%81-lt-tfoot-gt-%E6%A0%87%E7%AD%BE"><span class="toc-text">表格的&lt;thead&gt;标签、&lt;tbody&gt;标签、&lt;tfoot&gt;标签</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%A1%86%E6%9E%B6%E6%A0%87%E7%AD%BE"><span class="toc-text">框架标签</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-frameset-gt-%EF%BC%9A%E6%A1%86%E6%9E%B6%E7%9A%84%E9%9B%86%E5%90%88"><span class="toc-text">&lt;frameset&gt;：框架的集合</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-frame-gt-%EF%BC%9A%E6%A1%86%E6%9E%B6"><span class="toc-text">&lt;frame&gt;：框架</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%86%85%E5%B5%8C%E6%A1%86%E6%9E%B6"><span class="toc-text">内嵌框架</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%A1%A8%E5%8D%95%E6%A0%87%E7%AD%BE"><span class="toc-text">表单标签</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-input-gt-%EF%BC%9A%E8%BE%93%E5%85%A5%E6%A0%87%E7%AD%BE%EF%BC%88%E6%96%87%E6%9C%AC%E6%A1%86%EF%BC%89"><span class="toc-text">&lt;input&gt;：输入标签（文本框）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-select-gt-%EF%BC%9A%E4%B8%8B%E6%8B%89%E5%88%97%E8%A1%A8%E6%A0%87%E7%AD%BE"><span class="toc-text">&lt;select&gt;：下拉列表标签</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-textarea-gt-%E6%A0%87%E7%AD%BE%EF%BC%9A%E5%A4%9A%E8%A1%8C%E6%96%87%E6%9C%AC%E8%BE%93%E5%85%A5%E6%A1%86"><span class="toc-text">&lt;textarea&gt;标签：多行文本输入框</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%A1%A8%E5%8D%95%E7%9A%84%E8%AF%AD%E4%B9%89%E5%8C%96"><span class="toc-text">表单的语义化</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-label-gt-%E6%A0%87%E7%AD%BE"><span class="toc-text">&lt;label&gt;标签</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%A4%9A%E5%AA%92%E4%BD%93%E6%A0%87%E7%AD%BE"><span class="toc-text">多媒体标签</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-bgsound-gt-%E6%A0%87%E7%AD%BE%EF%BC%9A%E6%92%AD%E6%94%BE%E8%83%8C%E6%99%AF%E9%9F%B3%E4%B9%90"><span class="toc-text">&lt;bgsound&gt;标签：播放背景音乐</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-embed-gt-%E6%A0%87%E7%AD%BE%EF%BC%9A%E6%92%AD%E6%94%BE%E5%A4%9A%E5%AA%92%E4%BD%93%E6%96%87%E4%BB%B6%EF%BC%88%E9%9F%B3%E9%A2%91%E3%80%81%E8%A7%86%E9%A2%91%E7%AD%89%EF%BC%89"><span class="toc-text">&lt;embed&gt;标签：播放多媒体文件（音频、视频等）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-object-gt-%E6%A0%87%E7%AD%BE%EF%BC%9A%E6%92%AD%E6%94%BE%E5%A4%9A%E5%AA%92%E4%BD%93%E6%96%87%E4%BB%B6%EF%BC%88%E9%9F%B3%E9%A2%91%E3%80%81%E8%A7%86%E9%A2%91%E7%AD%89%EF%BC%89"><span class="toc-text">&lt;object&gt;标签：播放多媒体文件（音频、视频等）</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#lt-marquee-gt-%EF%BC%9A%E6%BB%9A%E5%8A%A8%E5%AD%97%E5%B9%95%E6%A0%87%E7%AD%BE"><span class="toc-text">&lt;marquee&gt;：滚动字幕标签</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#html%E5%BA%9F%E5%BC%83%E6%A0%87%E7%AD%BE%E4%BB%8B%E7%BB%8D"><span class="toc-text">html废弃标签介绍</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%88%91%E7%9A%84%E5%85%AC%E4%BC%97%E5%8F%B7"><span class="toc-text">我的公众号</span></a></li></ol>
      </div>
    </article>
  
  
  <article class="card card-content categories-widget">
    <div class="categories-card">
  <div class="categories-header">
    <i 
      class="iconfont icon-fenlei" 
      style="padding-right: 2px;">
    </i>分类
  </div>
  <div class="categories-list">
    
      <a href="/categories/%E5%89%8D%E7%AB%AF%E5%B7%A5%E5%85%B7/">
        <div class="categories-list-item">
          前端工具
          <span class="categories-list-item-badge">13</span>
        </div>
      </a>
    
      <a href="/categories/CSS%E5%9F%BA%E7%A1%80/">
        <div class="categories-list-item">
          CSS基础
          <span class="categories-list-item-badge">18</span>
        </div>
      </a>
    
      <a href="/categories/CSS%E8%BF%9B%E9%98%B6/">
        <div class="categories-list-item">
          CSS进阶
          <span class="categories-list-item-badge">9</span>
        </div>
      </a>
    
      <a href="/categories/HTML/">
        <div class="categories-list-item">
          HTML
          <span class="categories-list-item-badge">12</span>
        </div>
      </a>
    
      <a href="/categories/JS%E5%9F%BA%E7%A1%80/">
        <div class="categories-list-item">
          JS基础
          <span class="categories-list-item-badge">56</span>
        </div>
      </a>
    
      <a href="/categories/JS%E5%9F%BA%E7%A1%80ES6/">
        <div class="categories-list-item">
          JS基础ES6
          <span class="categories-list-item-badge">10</span>
        </div>
      </a>
    
      <a href="/categories/JS%E5%9F%BA%E7%A1%80%E5%BC%82%E6%AD%A5/">
        <div class="categories-list-item">
          JS基础异步
          <span class="categories-list-item-badge">11</span>
        </div>
      </a>
    
      <a href="/categories/JS%E8%BF%9B%E9%98%B6/">
        <div class="categories-list-item">
          JS进阶
          <span class="categories-list-item-badge">11</span>
        </div>
      </a>
    
      <a href="/categories/%E7%A7%BB%E5%8A%A8web/">
        <div class="categories-list-item">
          移动web
          <span class="categories-list-item-badge">3</span>
        </div>
      </a>
    
      <a href="/categories/CSS%E5%92%8CDOM/">
        <div class="categories-list-item">
          CSS和DOM
          <span class="categories-list-item-badge">6</span>
        </div>
      </a>
    
      <a href="/categories/Node/">
        <div class="categories-list-item">
          Node
          <span class="categories-list-item-badge">16</span>
        </div>
      </a>
    
      <a href="/categories/Vue%E5%9F%BA%E7%A1%80/">
        <div class="categories-list-item">
          Vue基础
          <span class="categories-list-item-badge">15</span>
        </div>
      </a>
    
      <a href="/categories/%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96/">
        <div class="categories-list-item">
          性能优化
          <span class="categories-list-item-badge">7</span>
        </div>
      </a>
    
      <a href="/categories/%E5%89%8D%E7%AB%AF%E5%B7%A5%E7%A8%8B%E5%8C%96/">
        <div class="categories-list-item">
          前端工程化
          <span class="categories-list-item-badge">8</span>
        </div>
      </a>
    
  </div>
</div>
  </article>
  
  <article class="card card-content tags-widget">
    <div class="tags-card">
  <div class="tags-header">
    <i 
      class="iconfont icon-biaoqian" 
      style="padding-right: 2px;">
    </i>热门标签
  </div>
  <div class="tags-list">
    
      <a 
        href="/tags/JS%E5%9F%BA%E7%A1%80/" 
        title="JS基础">
        <div class="tags-list-item">JS基础</div>
      </a>
    
      <a 
        href="/tags/CSS%E5%9F%BA%E7%A1%80/" 
        title="CSS基础">
        <div class="tags-list-item">CSS基础</div>
      </a>
    
      <a 
        href="/tags/Node/" 
        title="Node">
        <div class="tags-list-item">Node</div>
      </a>
    
      <a 
        href="/tags/Vue%E5%9F%BA%E7%A1%80/" 
        title="Vue基础">
        <div class="tags-list-item">Vue基础</div>
      </a>
    
      <a 
        href="/tags/%E5%89%8D%E7%AB%AF%E5%B7%A5%E5%85%B7/" 
        title="前端工具">
        <div class="tags-list-item">前端工具</div>
      </a>
    
      <a 
        href="/tags/HTML/" 
        title="HTML">
        <div class="tags-list-item">HTML</div>
      </a>
    
      <a 
        href="/tags/JS%E8%BF%9B%E9%98%B6/" 
        title="JS进阶">
        <div class="tags-list-item">JS进阶</div>
      </a>
    
      <a 
        href="/tags/JS%E5%9F%BA%E7%A1%80%E5%BC%82%E6%AD%A5/" 
        title="JS基础异步">
        <div class="tags-list-item">JS基础异步</div>
      </a>
    
      <a 
        href="/tags/JS%E5%9F%BA%E7%A1%80ES6/" 
        title="JS基础ES6">
        <div class="tags-list-item">JS基础ES6</div>
      </a>
    
      <a 
        href="/tags/CSS%E8%BF%9B%E9%98%B6/" 
        title="CSS进阶">
        <div class="tags-list-item">CSS进阶</div>
      </a>
    
      <a 
        href="/tags/%E5%89%8D%E7%AB%AF%E5%B7%A5%E7%A8%8B%E5%8C%96/" 
        title="前端工程化">
        <div class="tags-list-item">前端工程化</div>
      </a>
    
      <a 
        href="/tags/%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96/" 
        title="性能优化">
        <div class="tags-list-item">性能优化</div>
      </a>
    
      <a 
        href="/tags/CSS%E5%92%8CDOM/" 
        title="CSS和DOM">
        <div class="tags-list-item">CSS和DOM</div>
      </a>
    
      <a 
        href="/tags/%E7%A7%BB%E5%8A%A8web/" 
        title="移动web">
        <div class="tags-list-item">移动web</div>
      </a>
    
  </div>
</div>
  </article>
  
  
</div>
            </aside>
            <main class="main-column">
              
<article class="card card-content">
  <header>
    <h1 class="post-title">
      07-HTML标签图文详解（二）
    </h1>
  </header>
  <div class="post-meta post-show-meta">
    <time datetime="2000-12-31T16:00:00.000Z">
      <i 
        class="iconfont icon-calendar" 
        style="margin-right: 2px;">
      </i>
      <span>2001-01-01</span>
    </time>
    
      <span class="dot"></span>
      
        <a 
          href="/categories/HTML/" 
          class="post-meta-link">
          HTML
        </a>
      
    
    
      <span class="dot"></span>
      <span>8.3k 字</span>
    
  </div>
  
    <div 
      class="post-meta post-show-meta" 
      style="margin-top: -10px;">
      <div style="display: flex; align-items: center;">
        <i 
          class="iconfont icon-biaoqian" 
          style="margin-right: 2px; font-size: 1.15rem;">
        </i>
        
          
          <a 
            href="/tags/HTML/" 
            class="post-meta-link">
            HTML
          </a>
        
      </div>
    </div>
  
  </header>
  <div 
    id="section" 
    class="post-content">
    <p><ArticleTopAd></ArticleTopAd></p>
<h2 id="本文主要内容"><a href="#本文主要内容" class="headerlink" title="本文主要内容"></a>本文主要内容</h2><ul>
<li>列表标签：<code>&lt;ul&gt;</code>、<code>&lt;ol&gt;</code>、<code>&lt;dl&gt;</code></li>
<li>表格标签：<code>&lt;table&gt;</code></li>
<li>框架标签及内嵌框架<code>&lt;iframe&gt;</code></li>
<li>表单标签：<code>&lt;form&gt;</code></li>
<li>多媒体标签</li>
<li>滚动字幕标签：<code>&lt;marquee&gt;</code></li>
</ul>
<h2 id="列表标签"><a href="#列表标签" class="headerlink" title="列表标签"></a>列表标签</h2><p>列表标签分为三种。</p>
<h3 id="1、无序列表-lt-ul-gt-，无序列表中的每一项是-lt-li-gt"><a href="#1、无序列表-lt-ul-gt-，无序列表中的每一项是-lt-li-gt" class="headerlink" title="1、无序列表&lt;ul&gt;，无序列表中的每一项是&lt;li&gt;"></a>1、无序列表<code>&lt;ul&gt;</code>，无序列表中的每一项是<code>&lt;li&gt;</code></h3><p>英文单词解释如下：</p>
<ul>
<li>ul：unordered list，“无序列表”的意思。</li>
<li>li：list item，“列表项”的意思。</li>
</ul>
<p>例如：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">ul</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>默认1<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>默认2<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>默认3<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">ul</span>&gt;</span></span><br></pre>

<p>效果：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_01.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_01.png"></p>
<p>注意：</p>
<ul>
<li>li不能单独存在，必须包裹在ul里面；反过来说，ul的“儿子”不能是别的东西，只能有li。</li>
<li>我们这里再次强调，ul的作用，并不是给文字增加小圆点的，而是增加无序列表的“语义”的。</li>
</ul>
<p><strong>属性：</strong></p>
<ul>
<li><code>type=&quot;属性值&quot;</code>。属性值可以选： <code>disc</code>(实心原点，默认)，<code>square</code>(实心方点)，<code>circle</code>(空心圆)。<br>效果如下：</li>
</ul>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_02_1.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_02_1.png"></p>
<p>不光是<code>&lt;ul&gt;</code>标签有<code>type</code>属性，<code>&lt;ul&gt;</code>里面的<code>&lt;li&gt;</code>标签也有<code>type</code>属性（虽然说这种写法很少见）。效果如下：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_03.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_03.png"></p>
<p>注意：项目符号可以是图片，需要通过CSS设置<code>&lt;li&gt;</code>标记的背景图片来实现(CSS中讲)。</p>
<p>当然了，列表之间是可以<strong>嵌套</strong>的。我们来举个例子。代码：</p>
<pre class="highlight"><span class="line"> <span class="tag">&lt;<span class="name">ul</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">li</span>&gt;</span><span class="tag">&lt;<span class="name">b</span>&gt;</span>北京市<span class="tag">&lt;/<span class="name">b</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">ul</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">li</span>&gt;</span>海淀区<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">li</span>&gt;</span>朝阳区<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">li</span>&gt;</span>东城区<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line"></span><br><span class="line">	<span class="tag">&lt;/<span class="name">ul</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;<span class="name">li</span>&gt;</span><span class="tag">&lt;<span class="name">b</span>&gt;</span>广州市<span class="tag">&lt;/<span class="name">b</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">ul</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">li</span>&gt;</span>天河区<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">li</span>&gt;</span>越秀区<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">ul</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line"> <span class="tag">&lt;/<span class="name">ul</span>&gt;</span></span><br></pre>
<p>效果：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-01-cnblogs_html_40.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-01-cnblogs_html_40.png"></p>
<p><strong>css 属性</strong>：</p>
<pre class="highlight"><span class="line"><span class="attribute">list-style-position</span>: inside   <span class="comment">/* 给 ul 设置这个属性后，将小圆点包含在 li 元素的内部 */</span></span><br></pre>

<h4 id="ul标签实际应用场景："><a href="#ul标签实际应用场景：" class="headerlink" title="ul标签实际应用场景："></a>ul标签实际应用场景：</h4><p>场景1、导航条：</p>
<p><img src="https://img.smyhvae.com/20211031_1617.png" alt="20211031_1617" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="https://img.smyhvae.com/20211031_1617.png" class="lozad post-image"></p>
<p>场景2、li 里面放置的内容可能很多：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/20170704_1719.png" class="lozad post-image"src="http://img.smyhvae.com/20170704_1719.png"></p>
<p>声明：ul的儿子，只能是li。但是li是一个容器级标签，<strong>li里面什么都能放，甚至可以再放一个ul</strong>。</p>
<h3 id="2、有序列表-lt-ol-gt-，里面的每一项是-lt-li-gt"><a href="#2、有序列表-lt-ol-gt-，里面的每一项是-lt-li-gt" class="headerlink" title="2、有序列表&lt;ol&gt;，里面的每一项是&lt;li&gt;"></a>2、有序列表<code>&lt;ol&gt;</code>，里面的每一项是<code>&lt;li&gt;</code></h3><p>英文单词：Ordered List。</p>
<p>例如：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">ol</span> &gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>呵呵哒1<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>呵呵哒2<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>呵呵哒3<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">ol</span>&gt;</span></span><br></pre>

<p>效果：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_04.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_04.png"></p>
<p><strong>属性：</strong></p>
<ul>
<li><code>type=&quot;属性值&quot;</code>。属性值可以是：1(阿拉伯数字，默认)、a、A、i、I。结合<code>start</code>属性表示<code>从几开始</code>。</li>
</ul>
<p>举例：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">ol</span> <span class="attr">type</span>=<span class="string">&quot;1&quot;</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>呵呵<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>呵呵<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>呵呵<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">ol</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;<span class="name">ol</span> <span class="attr">type</span>=<span class="string">&quot;a&quot;</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>嘿嘿<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>嘿嘿<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>呵呵<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">ol</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;<span class="name">ol</span> <span class="attr">type</span>=<span class="string">&quot;i&quot;</span> <span class="attr">start</span>=<span class="string">&quot;4&quot;</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>哈哈<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>哈哈<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>哈哈<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">ol</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;<span class="name">ol</span> <span class="attr">type</span>=<span class="string">&quot;I&quot;</span> <span class="attr">start</span>=<span class="string">&quot;10&quot;</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>么么<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>么么<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>么么<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">ol</span>&gt;</span></span><br></pre>

<p>效果如下：<br><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_07.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_07.png"></p>
<p>和无序列表一样，有序列表也是可以嵌套的哦，这里就不举类似的例子了。</p>
<p>ol和ul就是语义不一样，怎么使用都是一样的。<br>ol里面只能有li，li必须被ol包裹。li是容器级。</p>
<p>ol这个东西用的不多，如果想表达顺序，大家一般也用ul。举例如下：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">ul</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>1. 小苹果<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>2. 月亮之上<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">li</span>&gt;</span>3. 最炫民族风<span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">ul</span>&gt;</span></span><br></pre>

<h3 id="3、定义列表-lt-dl-gt"><a href="#3、定义列表-lt-dl-gt" class="headerlink" title="3、定义列表&lt;dl&gt;"></a>3、定义列表<code>&lt;dl&gt;</code></h3><blockquote>
<p>定义列表的作用非常大。</p>
</blockquote>
<p><code>&lt;dl&gt;</code>英文单词：definition list，没有属性。dl的子元素只能是dt和dd。</p>
<ul>
<li><code>&lt;dt&gt;</code>：definition title 列表的标题，这个标签是必须的</li>
<li><code>&lt;dd&gt;</code>：definition description 列表的列表项，如果不需要它，可以不加</li>
</ul>
<p>备注：dt、dd只能在dl里面；dl里面只能有dt、dd。</p>
<p>举例：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">dl</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dt</span>&gt;</span>第一条<span class="tag">&lt;/<span class="name">dt</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dd</span>&gt;</span>你若是觉得你有实力和我玩，良辰不介意奉陪到底<span class="tag">&lt;/<span class="name">dd</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dd</span>&gt;</span>我会让你明白，我从不说空话<span class="tag">&lt;/<span class="name">dd</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dd</span>&gt;</span>我是本地的，我有一百种方式让你呆不下去；而你，无可奈何<span class="tag">&lt;/<span class="name">dd</span>&gt;</span></span><br><span class="line"></span><br><span class="line">	<span class="tag">&lt;<span class="name">dt</span>&gt;</span>第二条<span class="tag">&lt;/<span class="name">dt</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dd</span>&gt;</span>良辰最喜欢对那些自认能力出众的人出手<span class="tag">&lt;/<span class="name">dd</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dd</span>&gt;</span>你可以继续我行我素，不过，你的日子不会很舒心<span class="tag">&lt;/<span class="name">dd</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dd</span>&gt;</span>你只要记住，我叫叶良辰<span class="tag">&lt;/<span class="name">dd</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dd</span>&gt;</span>不介意陪你玩玩<span class="tag">&lt;/<span class="name">dd</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dd</span>&gt;</span>良辰必有重谢<span class="tag">&lt;/<span class="name">dd</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;/<span class="name">dl</span>&gt;</span></span><br></pre>

<p>效果：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_09.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_09.png"></p>
<p>上图可以看出，定义列表表达的语义是两层：</p>
<ul>
<li>（1）是一个列表，列出了几个dd项目</li>
<li>（2）每一个词儿都有自己的描述项。</li>
</ul>
<p>备注：dd是描述dt的。</p>
<p>定义列表用法非常灵活，可以一个dt配很多dd：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">dl</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dt</span>&gt;</span>北京<span class="tag">&lt;/<span class="name">dt</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dd</span>&gt;</span>国家首都，政治文化中心<span class="tag">&lt;/<span class="name">dd</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dd</span>&gt;</span>污染很严重，PM2.0天天报表<span class="tag">&lt;/<span class="name">dd</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dt</span>&gt;</span>上海<span class="tag">&lt;/<span class="name">dt</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dd</span>&gt;</span>魔都，有外滩、东方明珠塔、黄浦江<span class="tag">&lt;/<span class="name">dd</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dt</span>&gt;</span>广州<span class="tag">&lt;/<span class="name">dt</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dd</span>&gt;</span>中国南大门，有珠江、小蛮腰<span class="tag">&lt;/<span class="name">dd</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">dl</span>&gt;</span></span><br></pre>

<p>还可以拆开，让每一个dl里面只有一个dt和dd，这样子感觉清晰一些：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">dl</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dt</span>&gt;</span>北京<span class="tag">&lt;/<span class="name">dt</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dd</span>&gt;</span>国家首都，政治文化中心<span class="tag">&lt;/<span class="name">dd</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dd</span>&gt;</span>污染很严重，PM2.0天天报表<span class="tag">&lt;/<span class="name">dd</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">dl</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;<span class="name">dl</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dt</span>&gt;</span>上海<span class="tag">&lt;/<span class="name">dt</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dd</span>&gt;</span>魔都，有外滩、东方明珠塔、黄浦江<span class="tag">&lt;/<span class="name">dd</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">dl</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;<span class="name">dl</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dt</span>&gt;</span>广州<span class="tag">&lt;/<span class="name">dt</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dd</span>&gt;</span>中国南大门，有珠江、小蛮腰<span class="tag">&lt;/<span class="name">dd</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">dl</span>&gt;</span></span><br></pre>

<p>真实案例：（京东最下方）</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/20170704_1727.png" class="lozad post-image"src="http://img.smyhvae.com/20170704_1727.png"></p>
<p>上图中的结构如下：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">dl</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dt</span>&gt;</span>购物指南<span class="tag">&lt;/<span class="name">dt</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dd</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;#&quot;</span>&gt;</span>购物流程<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;#&quot;</span>&gt;</span>会员介绍<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;#&quot;</span>&gt;</span>生活旅行/团购<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;#&quot;</span>&gt;</span>常见问题<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;#&quot;</span>&gt;</span>大家电<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;#&quot;</span>&gt;</span>联系客服<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">dd</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">dl</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">dl</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dt</span>&gt;</span>配送方式<span class="tag">&lt;/<span class="name">dt</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">dd</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;#&quot;</span>&gt;</span>上门自提<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;#&quot;</span>&gt;</span>211限时达<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;#&quot;</span>&gt;</span>配送服务查询<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;#&quot;</span>&gt;</span>配送费收取标准<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;#&quot;</span>&gt;</span>海外配送<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">dd</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">dl</span>&gt;</span></span><br><span class="line"></span><br></pre>

<p>京东商品分类如下：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/20170704_1729.png" class="lozad post-image"src="http://img.smyhvae.com/20170704_1729.png"></p>
<p>dt、dd都是容器级标签，想放什么都可以。所以，现在就应该更加清晰的知道：用什么标签，不是根据样子来决定，而是语义（语义本质上是结构）。</p>
<h2 id="表格标签"><a href="#表格标签" class="headerlink" title="表格标签"></a>表格标签</h2><p>表格标签用<code>&lt;table&gt;</code>表示。<br>一个表格<code>&lt;table&gt;</code>是由每行<code>&lt;tr&gt;</code>组成的，每行是由每个单元格<code>&lt;td&gt;</code>组成的。<br>所以我们要记住，一个表格是由行组成的（行是由列组成的），而不是由行和列组成的。<br>在以前，要想固定标签的位置，唯一的方法就是表格。现在可以通过CSS定位的功能来实现。但是现在在做页面的时候，表格作用还是有一些的。</p>
<p>例如，一行的单元格：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">table</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">tr</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span><span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span><span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span><span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span><span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">tr</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">table</span>&gt;</span></span><br></pre>
<p>上面的表格中没有加文字，所以在生成的网页中什么都看不到。<br>例如，3行4列的单元格：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">table</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">tr</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>千古壹号<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>23<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>男<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>黄冈<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">tr</span>&gt;</span></span><br><span class="line"></span><br><span class="line">	<span class="tag">&lt;<span class="name">tr</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>许嵩<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>29<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>男<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>安徽<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">tr</span>&gt;</span></span><br><span class="line"></span><br><span class="line">	<span class="tag">&lt;<span class="name">tr</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>邓紫棋<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>23<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>女<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>香港<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">tr</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;/<span class="name">table</span>&gt;</span></span><br></pre>
<p>效果：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_10.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_10.png"></p>
<p>上图中的表格好像没看到边框呀，不急，接下来看看<code>&lt;table&gt;</code>标签的属性。</p>
<p><strong><code>&lt;table&gt;</code>的属性：</strong></p>
<ul>
<li><code>border</code>：边框。像素为单位。</li>
<li><code>style=&quot;border-collapse:collapse;&quot;</code>：单元格的线和表格的边框线合并（表格的两边框合并为一条）</li>
<li><code>width</code>：宽度。像素为单位。</li>
<li><code>height</code>：高度。像素为单位。</li>
<li><code>bordercolor</code>：表格的边框颜色。</li>
<li><code>align</code>：<strong>表格</strong>的水平对齐方式。属性值可以填：left right center。<br>注意：这里不是设置表格里内容的对齐方式，如果想设置内容的对齐方式，要对单元格标签<code>&lt;td&gt;</code>进行设置）</li>
<li><code>cellpadding</code>：单元格内容到边的距离，像素为单位。默认情况下，文字是紧挨着左边那条线的，即默认情况下的值为0。<br>注意不是单元格内容到四条边的距离哈，而是到一条边的距离，默认是与左边那条线的距离。如果设置属性<code>dir=&quot;rtl&quot;</code>，那就指的是内容到右边那条线的距离。</li>
<li><code>cellspacing</code>：单元格和单元格之间的距离（外边距），像素为单位。默认情况下的值为0</li>
<li><code>bgcolor=&quot;#99cc66&quot;</code>：表格的背景颜色。</li>
<li><code>background=&quot;路径src/...&quot;</code>：背景图片。<br>背景图片的优先级大于背景颜色。</li>
<li><code>bordercolorlight</code>：表格的上、左边框，以及单元格的右、下边框的颜色</li>
<li><code>bordercolordark</code>：表格的右、下边框，以及单元格的上、左的边框的颜色<br>这两个属性的目的是为了设置3D的效果。</li>
<li><code>dir</code>：公有属性，单元格内容的排列方式(direction)。 可以 取值：<code>ltr</code>：从左到右（left to right，默认），<code>rtl</code>：从右到左（right to left）<br>既然说<code>dir</code>是共有属性，如果把这个属性放在任意标签中，那表明这个标签的位置可能会从右开始排列。</li>
</ul>
<p>单元格带边框的效果：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_11.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_11.png"></p>
<p>备注：表格中很细表格边线的制作，CSS的写法：</p>
<pre class="highlight"><span class="line">style=&quot;<span class="attribute">border-collapse</span>:collapse;&quot;</span><br></pre>


<h3 id="lt-tr-gt-：行"><a href="#lt-tr-gt-：行" class="headerlink" title="&lt;tr&gt;：行"></a><code>&lt;tr&gt;</code>：行</h3><p>一个表格就是一行一行组成的。</p>
<p><strong>属性：</strong></p>
<ul>
<li><code>dir</code>：公有属性，设置这一行单元格内容的排列方式。可以取值：<ul>
<li><code>ltr</code>：从左到右（left to right，默认）</li>
<li><code>rtl</code>：从右到左（right to left）</li>
</ul>
</li>
<li><code>bgcolor</code>：设置这一行的单元格的背景色。<br>注：没有background属性，即：无法设置这一行的背景图片，如果非要设置，可以用css实现。</li>
<li><code>height</code>：一行的高度</li>
<li><code>align=&quot;center&quot;</code>：一行的内容水平居中显示，取值：left、center、right</li>
<li><code>valign=&quot;center&quot;</code>：一行的内容垂直居中，取值：top、middle、bottom</li>
</ul>
<h3 id="lt-td-gt-：单元格"><a href="#lt-td-gt-：单元格" class="headerlink" title="&lt;td&gt;：单元格"></a><code>&lt;td&gt;</code>：单元格</h3><p><strong>属性：</strong></p>
<ul>
<li><code>align</code>：内容的横向对齐方式。属性值可以填：left right center。如果想让每个单元格的内容都居中，这个属性太麻烦了，以后用css来解决。</li>
<li><code>valign</code>：内容的纵向对齐方式。属性值可以填：top middle bottom</li>
<li><code>width</code>：绝对值或者相对值(%)</li>
<li><code>height</code>：单元格的高度</li>
<li><code>bgcolor</code>：设置这个单元格的背景色。</li>
<li><code>background</code>：设置这个单元格的背景图片。</li>
</ul>
<h3 id="单元格的合并"><a href="#单元格的合并" class="headerlink" title="单元格的合并"></a>单元格的合并</h3><p>单元格的属性：</p>
<ul>
<li><code>colspan</code>：横向合并。例如<code>colspan=&quot;2&quot;</code>表示当前单元格在水平方向上要占据两个单元格的位置。</li>
<li><code>rowspan</code>：纵向合并。例如<code>rowspan=&quot;2&quot;</code>表示当前单元格在垂直方向上要占据两个单元格的位置。</li>
</ul>
<p>效果举例：（横向合并）</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_13.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_13.png"></p>
<p>效果举例：（纵向合并）</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_15.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_15.png"></p>
<h3 id="lt-th-gt-：加粗的单元格。相当于-lt-td-gt-lt-b-gt"><a href="#lt-th-gt-：加粗的单元格。相当于-lt-td-gt-lt-b-gt" class="headerlink" title="&lt;th&gt;：加粗的单元格。相当于&lt;td&gt; + &lt;b&gt;"></a><code>&lt;th&gt;</code>：加粗的单元格。相当于<code>&lt;td&gt;</code> + <code>&lt;b&gt;</code></h3><ul>
<li>属性同<code>&lt;td&gt;</code>标签。</li>
</ul>
<h3 id="lt-caption-gt-：表格的标题。使用时和tr标签并列"><a href="#lt-caption-gt-：表格的标题。使用时和tr标签并列" class="headerlink" title="&lt;caption&gt;：表格的标题。使用时和tr标签并列"></a><code>&lt;caption&gt;</code>：表格的标题。使用时和<code>tr</code>标签并列</h3><ul>
<li>属性：<code>align</code>，表示标题相对于表格的位置。属性取值可以是：left、center、right、top、bottom<br>效果：</li>
</ul>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_16.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_16.png"></p>
<h3 id="表格的-lt-thead-gt-标签、-lt-tbody-gt-标签、-lt-tfoot-gt-标签"><a href="#表格的-lt-thead-gt-标签、-lt-tbody-gt-标签、-lt-tfoot-gt-标签" class="headerlink" title="表格的&lt;thead&gt;标签、&lt;tbody&gt;标签、&lt;tfoot&gt;标签"></a>表格的<code>&lt;thead&gt;</code>标签、<code>&lt;tbody&gt;</code>标签、<code>&lt;tfoot&gt;</code>标签</h3><p>这三个标签有与没有的区别：</p>
<ul>
<li>1、如果写了，那么这三个部分的<strong>代码顺序可以任意</strong>，浏览器显示的时候还是按照thead、tbody、tfoot的顺序依次来显示内容。如果不写thead、tbody、tfoot，那么浏览器解析并显示表格内容的时候是从按照代码的从上到下的顺序来显示。</li>
<li>2、当表格非常大内容非常多的时候，如果用thead、tbody、tfoot标签的话，那么<strong>数据可以边获取边显示</strong>。如果不写，则必须等表格的内容全部从服务器获取完成才能显示出来。</li>
</ul>
<p>举例：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">body</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;<span class="name">table</span> <span class="attr">border</span>=<span class="string">&quot;1&quot;</span>&gt;</span></span><br><span class="line"></span><br><span class="line">	<span class="tag">&lt;<span class="name">tbody</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">tr</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>生命壹号<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>23<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>男<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>黄冈<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">tr</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">tbody</span>&gt;</span></span><br><span class="line"></span><br><span class="line">	<span class="tag">&lt;<span class="name">tfoot</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">tr</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>许嵩<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>29<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>男<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>安徽<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">tr</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">tfoot</span>&gt;</span></span><br><span class="line"></span><br><span class="line">	<span class="tag">&lt;<span class="name">thead</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">tr</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>邓紫棋<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>23<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>女<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">td</span>&gt;</span>香港<span class="tag">&lt;/<span class="name">td</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">tr</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">thead</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;/<span class="name">table</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></span><br></pre>

<p>效果：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_17.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_17.png"></p>
<h2 id="框架标签"><a href="#框架标签" class="headerlink" title="框架标签"></a>框架标签</h2><p>如果我们希望在一个网页中显示多个页面，那框架标签就派上用场了。</p>
<blockquote>
<ul>
<li>注意，框架标签不能放在<code>&lt;body&gt;</code>标签里面，因为<code>&lt;body&gt;</code>标签代表的只是一个页面，而框架标签代表的是多个页面。于是：<code>&lt;frameset&gt;</code>和<code>&lt;body&gt;</code>只能二选一。</li>
<li>框架的集合用<code>&lt;frameset&gt;</code>表示，然后在<code>&lt;frameset&gt;</code>集合里放入一个一个的框架<code>&lt;frame&gt;</code></li>
</ul>
</blockquote>
<p><strong>补充</strong>：<code>frameset</code>和<code>frame</code>已经从 Web标准中删除，建议使用 iframe 代替。</p>
<h3 id="lt-frameset-gt-：框架的集合"><a href="#lt-frameset-gt-：框架的集合" class="headerlink" title="&lt;frameset&gt;：框架的集合"></a><code>&lt;frameset&gt;</code>：框架的集合</h3><p>一个框架的集合可以包含多个框架或框架的集合。<strong>属性：</strong></p>
<ul>
<li><code>rows</code>：水平分割，将框架分为上下部分。写法有两种：</li>
</ul>
<p>1、绝对值写法：<code>rows=&quot;200,*&quot;</code>  其中<code>*</code>代表剩余的。这里其实包含了两个框架：上面的框架占200个像素，下面的框架占剩下的部分。</p>
<p>2、相对值写法：<code>rows=&quot;30%,*&quot;</code>  其中<code>*</code>代表剩余的。这里其实包含了两个框架：上面的框架占30%，下面的框架占70%。</p>
<p>注：如果你想将框架分成很多行，在属性值里用逗号隔开就行了。</p>
<ul>
<li><code>cols</code>：垂直分割，将框架分为左右部分。写法有两种：</li>
</ul>
<p>1、绝对值写法：<code>cols=&quot;200,*&quot;</code>  其中<code>*</code>代表剩余的。这里其实包含了两个框架：左边的框架占200个像素，右边的框架占剩下的部分。</p>
<p>2、相对值写法：<code>cols=&quot;30%,*&quot;</code>  其中<code>*</code>代表剩余的。这里其实包含了两个框架：左边的框架占30%，右边的框架占70%。</p>
<p>注：如果你想将框架分成很多列，在属性值里用逗号隔开就行了。</p>
<p>效果：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_26.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_26.png"></p>
<p>上图中，如果删掉页面right.html，显示效果如下：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_27.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_27.png"></p>
<h3 id="lt-frame-gt-：框架"><a href="#lt-frame-gt-：框架" class="headerlink" title="&lt;frame&gt;：框架"></a><code>&lt;frame&gt;</code>：框架</h3><p>一个框架显示一个页面。</p>
<p><strong>属性：</strong></p>
<ul>
<li><code>scrolling=&quot;no&quot;</code>：是否需要滚动条。默认值是true。</li>
<li><code>noresize</code>：不可以改变框架大小。默认情况下，单个框架的边界是可以拖动的，这样的话，框架大小就不固定了。如果用了这个属性值，框架大小将固定。</li>
</ul>
<p>举例：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">frame</span> <span class="attr">src</span>=<span class="string">&quot;top.html&quot;</span> <span class="attr">noresize</span>&gt;</span><span class="tag">&lt;/<span class="name">frame</span>&gt;</span></span><br></pre>

<ul>
<li><p><code>bordercolor=&quot;#00FF00&quot;</code>：给框架的边框定义颜色。这个属性在框架集合<code>&lt;frameset&gt;</code>中同样适用。<br>颜色这个属性在IE浏览器中生效，但是在google浏览器中无效，不知道为啥。</p>
</li>
<li><p><code>frameborder=&quot;0&quot;</code>或<code>frameborder=&quot;1&quot;</code>：隐藏或显示边框（框架线）。</p>
</li>
<li><p><code>name</code>：给框架起一个名字。</p>
</li>
</ul>
<p>利用<code>name</code>这个属性，我们可以在框架里进行超链。</p>
<p>举例：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_28.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_28.png"></p>
<p>效果：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_gif3.gif" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_gif3.gif"></p>
<h2 id="内嵌框架"><a href="#内嵌框架" class="headerlink" title="内嵌框架"></a>内嵌框架</h2><p>内嵌框架用<code>&lt;iframe&gt;</code>表示。<code>&lt;iframe&gt;</code>是<code>&lt;body&gt;</code>的子标记。</p>
<p>内嵌框架inner frame：嵌入在一个页面上的框架(仅仅IE、新版google浏览器支持，可能有其他浏览器也支持，暂时我不清楚)。</p>
<p><strong>属性：</strong></p>
<ul>
<li><code>src=&quot;subframe/the_second.html&quot;</code>：内嵌的那个页面</li>
<li><code>width=800</code>：宽度</li>
<li><code>height=“150</code>：高度</li>
<li><code>scrolling=&quot;no&quot;</code>：是否需要滚动条。默认值是true。</li>
<li><code>name=&quot;mainFrame&quot;</code>：窗口名称。公有属性。</li>
</ul>
<p>效果：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_29.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_29.png"></p>
<p>内嵌框架举例：（在内嵌页面中切换显示不同的压面）</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">body</span>&gt;</span></span><br><span class="line"></span><br><span class="line">	<span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;文字页面.html&quot;</span> <span class="attr">target</span>=<span class="string">&quot;myframe&quot;</span>&gt;</span>默认显示文字页面<span class="tag">&lt;/<span class="name">a</span>&gt;</span><span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;图片页面.html&quot;</span> <span class="attr">target</span>=<span class="string">&quot;myframe&quot;</span>&gt;</span>点击进入图片页面<span class="tag">&lt;/<span class="name">a</span>&gt;</span><span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;表格页面.html&quot;</span> <span class="attr">target</span>=<span class="string">&quot;myframe&quot;</span>&gt;</span>点击进入表格页面<span class="tag">&lt;/<span class="name">a</span>&gt;</span><span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line"></span><br><span class="line">	<span class="tag">&lt;<span class="name">iframe</span> <span class="attr">src</span>=<span class="string">&quot;文字页面.html&quot;</span> <span class="attr">width</span>=<span class="string">&quot;400&quot;</span> <span class="attr">height</span>=<span class="string">&quot;400&quot;</span> <span class="attr">name</span>=<span class="string">&quot;myframe&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">iframe</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line">	嘿嘿</span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></span><br><span class="line"></span><br></pre>

<p>效果演示：<br><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_GIF.gif" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_GIF.gif"></p>
<h2 id="表单标签"><a href="#表单标签" class="headerlink" title="表单标签"></a>表单标签</h2><p>表单标签用<code>&lt;form&gt;</code>表示，用于与服务器的交互。表单就是收集用户信息的，就是让用户填写的、选择的。</p>
<p><strong>属性：</strong></p>
<ul>
<li><code>name</code>：表单的名称，用于JS来操作或控制表单时使用；</li>
<li><code>id</code>：表单的名称，用于JS来操作或控制表单时使用；</li>
<li><code>action</code>：指定表单数据的处理程序，一般是PHP，如：action&#x3D;“login.php”</li>
<li><code>method</code>：表单数据的提交方式，一般取值：get(默认)和post</li>
</ul>
<p>注意：表单和表格嵌套时，是在<code>&lt;form&gt;</code>标记中套<code>&lt;table&gt;</code>标记。</p>
<p>form标签里面的action属性和method属性，在后续的 ajax文章上再讲。这里简单说一下：action属性就是表示，表单将提交到哪里。 method属性表示用什么HTTP方法提交，有get、post两种。</p>
<p><strong>get提交和post提交的区别：</strong></p>
<p>GET方式：<br>将表单数据，以”name&#x3D;value”形式追加到action指定的处理程序的后面，两者间用”?”隔开，每一个表单的”name&#x3D;value”间用”&amp;”号隔开。<br>特点：只适合提交少量信息，并且不太安全(不要提交敏感数据)、提交的数据类型只限于ASCII字符。</p>
<p>POST方式：<br>将表单数据直接发送(隐藏)到action指定的处理程序。POST发送的数据不可见。Action指定的处理程序可以获取到表单数据。<br>特点：可以提交海量信息，相对来说安全一些，提交的数据格式是多样的(Word、Excel、rar、img)。</p>
<p><strong>Enctype：</strong><br>表单数据的编码方式(加密方式)，取值可以是：application&#x2F;x-www-form-urlencoded、multipart&#x2F;form-data。Enctype只能在POST方式下使用。</p>
<ul>
<li>Application&#x2F;x-www-form-urlencoded：<strong>默认</strong>加密方式，除了上传文件之外的数据都可以</li>
<li>Multipart&#x2F;form-data：<strong>上传附件时，必须使用这种编码方式</strong>。</li>
</ul>
<h3 id="lt-input-gt-：输入标签（文本框）"><a href="#lt-input-gt-：输入标签（文本框）" class="headerlink" title="&lt;input&gt;：输入标签（文本框）"></a><code>&lt;input&gt;</code>：输入标签（文本框）</h3><p>用于接收用户输入。</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;text&quot;</span> /&gt;</span></span><br></pre>

<p><strong>属性：</strong></p>
<ul>
<li><p>**<code>type=&quot;属性值&quot;</code>**：文本类型。属性值可以是：</p>
<ul>
<li><code>text</code>（默认）</li>
<li><code>password</code>：密码类型</li>
<li><code>radio</code>：单选按钮，名字相同的按钮作为一组进行单选（单选按钮，天生是不能互斥的，如果想互斥，必须要有相同的name属性。name就是“名字”。<br>  ）。非常像以前的收音机，按下去一个按钮，其他的就抬起来了。所以叫做radio。</li>
<li><code>checkbox</code>：多选按钮，<strong>name 属性值相同的按钮</strong>作为一组进行选择。</li>
<li><code>checked</code>：将单选按钮或多选按钮默认处于选中状态。当<code>&lt;input&gt;</code>标签设置为<code>type=&quot;radio&quot;</code>或者<code>type=checkbox</code>时，可以用这个属性。属性值也是checked，可以省略。</li>
<li><code>hidden</code>：隐藏框，在表单中包含不希望用户看见的信息</li>
<li><code>button</code>：普通按钮，结合js代码进行使用。</li>
<li><code>submit</code>：提交按钮，传送当前表单的数据给服务器或其他程序处理。这个按钮不需要写value自动就会有“提交”文字。这个按钮真的有提交功能。点击按钮后，这个表单就会被提交到form标签的action属性中指定的那个页面中去。</li>
<li><code>reset</code>：重置按钮，清空当前表单的内容，并设置为最初的默认值</li>
<li><code>image</code>：图片按钮，和提交按钮的功能完全一致，只不过图片按钮可以显示图片。</li>
<li><code>file</code>：文件选择框。<br>  提示：如果要限制上传文件的类型，需要配合JS来实现验证。对上传文件的安全检查：一是扩展名的检查，二是文件数据内容的检查。</li>
</ul>
</li>
<li><p>**<code>value=&quot;内容&quot;</code>**：文本框里的默认内容（已经被填好了的）</p>
</li>
<li><p><code>size=&quot;50&quot;</code>：表示文本框内可以显示<strong>五十个字符</strong>。一个英文或一个中文都算一个字符。<br>注意<strong>size属性值的单位不是像素哦</strong>。</p>
</li>
<li><p><code>readonly</code>：文本框只读，不能编辑。因为它的属性值也是readonly，所以属性值可以不写。<br>用了这个属性之后，在google浏览器中，光标点不进去；在IE浏览器中，光标可以点进去，但是文字不能编辑。</p>
</li>
<li><p><code>disabled</code>：文本框只读，不能编辑，光标点不进去。属性值可以不写。</p>
</li>
</ul>
<blockquote>
<p>备注：HTML5中，input的类型又增加了很多（比如date、color，我们会在 html5 中讲到）。</p>
</blockquote>
<p><strong>举例</strong>：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">form</span>&gt;</span></span><br><span class="line">	姓名：<span class="tag">&lt;<span class="name">input</span> <span class="attr">value</span>=<span class="string">&quot;呵呵&quot;</span> &gt;</span>逗比<span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line">	昵称：<span class="tag">&lt;<span class="name">input</span> <span class="attr">value</span>=<span class="string">&quot;哈哈&quot;</span> <span class="attr">readonly</span>=<span class="string">&quot;&quot;</span>&gt;</span><span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line">	名字：<span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;text&quot;</span> <span class="attr">value</span>=<span class="string">&quot;name&quot;</span> <span class="attr">disabled</span>=<span class="string">&quot;&quot;</span>&gt;</span><span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line">	密码：<span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;password&quot;</span> <span class="attr">value</span>=<span class="string">&quot;pwd&quot;</span> <span class="attr">size</span>=<span class="string">&quot;50&quot;</span>&gt;</span><span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line">	性别：<span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;radio&quot;</span> <span class="attr">name</span>=<span class="string">&quot;gender&quot;</span> <span class="attr">id</span>=<span class="string">&quot;radio1&quot;</span> <span class="attr">value</span>=<span class="string">&quot;male&quot;</span> <span class="attr">checked</span>=<span class="string">&quot;&quot;</span>&gt;</span>男</span><br><span class="line">		  <span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;radio&quot;</span> <span class="attr">name</span>=<span class="string">&quot;gender&quot;</span> <span class="attr">id</span>=<span class="string">&quot;radio2&quot;</span> <span class="attr">value</span>=<span class="string">&quot;female&quot;</span> &gt;</span>女<span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line">	爱好：<span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;checkbox&quot;</span> <span class="attr">name</span>=<span class="string">&quot;love&quot;</span> <span class="attr">value</span>=<span class="string">&quot;eat&quot;</span>&gt;</span>吃饭</span><br><span class="line">		  <span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;checkbox&quot;</span> <span class="attr">name</span>=<span class="string">&quot;love&quot;</span> <span class="attr">value</span>=<span class="string">&quot;sleep&quot;</span>&gt;</span>睡觉</span><br><span class="line">		  <span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;checkbox&quot;</span> <span class="attr">name</span>=<span class="string">&quot;love&quot;</span> <span class="attr">value</span>=<span class="string">&quot;bat&quot;</span>&gt;</span>打豆豆</span><br><span class="line"><span class="tag">&lt;/<span class="name">form</span>&gt;</span></span><br></pre>

<p>效果：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_33.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_33.png"></p>
<p>注意，多个单选框的input标签中，name 的属性值可以相同，但是 <strong>id 的属性值必须是唯一的</strong>。我们知道，html的标签中，id的属性值是唯一的。</p>
<p><strong>四种按钮的举例</strong>：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">form</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;button&quot;</span> <span class="attr">value</span>=<span class="string">&quot;普通按钮&quot;</span>&gt;</span><span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;submit&quot;</span>  <span class="attr">value</span>=<span class="string">&quot;提交按钮&quot;</span>&gt;</span><span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;reset&quot;</span> <span class="attr">value</span>=<span class="string">&quot;重置按钮&quot;</span>&gt;</span><span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;image&quot;</span> <span class="attr">value</span>=<span class="string">&quot;图片按钮1&quot;</span>&gt;</span><span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;image&quot;</span> <span class="attr">src</span>=<span class="string">&quot;1.jpg&quot;</span> <span class="attr">width</span>=<span class="string">&quot;800&quot;</span> <span class="attr">value</span>=<span class="string">&quot;图片按钮2&quot;</span>&gt;</span><span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;file&quot;</span> <span class="attr">value</span>=<span class="string">&quot;文件选择框&quot;</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">form</span>&gt;</span></span><br></pre>

<p><strong>前端开发工程师，重点关心页面的美、样式、板式、交互。至于数据的提供和比较重的业务逻辑，都是后台工程师做的事情。</strong></p>
<p>效果：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_35.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_35.png"></p>
<h3 id="lt-select-gt-：下拉列表标签"><a href="#lt-select-gt-：下拉列表标签" class="headerlink" title="&lt;select&gt;：下拉列表标签"></a><code>&lt;select&gt;</code>：下拉列表标签</h3><p><code>&lt;select&gt;</code>标签里面的每一项用<code>&lt;option&gt;</code>表示。select就是“选择”，option“选项”。</p>
<p>select标签和ul、ol、dl一样，都是组标签。</p>
<p><strong><code>&lt;select&gt;</code>标签的属性：</strong></p>
<ul>
<li><code>multiple</code>：可以对下拉列表中的选项进行多选。属性值为 multiple，也可以没有属性值。也就是说，既可以写成 <code>multiple=&quot;&quot;</code>，也可以写成<code>multiple=&quot;multiple&quot;</code>。</li>
<li><code>size=&quot;3&quot;</code>：如果属性值大于1，则列表为滚动视图。默认属性值为1，即下拉视图。</li>
</ul>
<p><strong><code>&lt;option&gt;</code>标签的属性：</strong></p>
<ul>
<li><code>selected</code>：预选中。没有属性值。</li>
</ul>
<p>举例：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">form</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">select</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">option</span>&gt;</span>小学<span class="tag">&lt;/<span class="name">option</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">option</span>&gt;</span>初中<span class="tag">&lt;/<span class="name">option</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">option</span>&gt;</span>高中<span class="tag">&lt;/<span class="name">option</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">option</span>&gt;</span>大学<span class="tag">&lt;/<span class="name">option</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">option</span> <span class="attr">selected</span>=<span class="string">&quot;&quot;</span>&gt;</span>研究生<span class="tag">&lt;/<span class="name">option</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">select</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">br</span>&gt;</span><span class="tag">&lt;<span class="name">br</span>&gt;</span><span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line"></span><br><span class="line">	<span class="tag">&lt;<span class="name">select</span> <span class="attr">size</span>=<span class="string">&quot;3&quot;</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">option</span>&gt;</span>小学<span class="tag">&lt;/<span class="name">option</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">option</span>&gt;</span>初中<span class="tag">&lt;/<span class="name">option</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">option</span>&gt;</span>高中<span class="tag">&lt;/<span class="name">option</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">option</span>&gt;</span>大学<span class="tag">&lt;/<span class="name">option</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">option</span>&gt;</span>研究生<span class="tag">&lt;/<span class="name">option</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">select</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">br</span>&gt;</span><span class="tag">&lt;<span class="name">br</span>&gt;</span><span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line"></span><br><span class="line">	<span class="tag">&lt;<span class="name">select</span> <span class="attr">multiple</span>=<span class="string">&quot;&quot;</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">option</span>&gt;</span>小学<span class="tag">&lt;/<span class="name">option</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">option</span>&gt;</span>初中<span class="tag">&lt;/<span class="name">option</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">option</span> <span class="attr">selected</span>=<span class="string">&quot;&quot;</span>&gt;</span>高中<span class="tag">&lt;/<span class="name">option</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">option</span> <span class="attr">selected</span>=<span class="string">&quot;&quot;</span>&gt;</span>大学<span class="tag">&lt;/<span class="name">option</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">option</span>&gt;</span>研究生<span class="tag">&lt;/<span class="name">option</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">select</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">br</span>&gt;</span><span class="tag">&lt;<span class="name">br</span>&gt;</span><span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;/<span class="name">form</span>&gt;</span></span><br></pre>

<p>效果：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_32.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_32.png"></p>
<h3 id="lt-textarea-gt-标签：多行文本输入框"><a href="#lt-textarea-gt-标签：多行文本输入框" class="headerlink" title="&lt;textarea&gt;标签：多行文本输入框"></a><code>&lt;textarea&gt;</code>标签：多行文本输入框</h3><p>text 就是“文本”，area 就是“区域”。</p>
<p><strong>属性：</strong></p>
<ul>
<li><code>rows=&quot;4&quot;</code>：指定文本区域的行数。</li>
<li><code>cols=&quot;20&quot;</code>：指定文本区域的列数。</li>
<li><code>readonly</code>：只读。</li>
</ul>
<p>举例：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">form</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">textarea</span> <span class="attr">name</span>=<span class="string">&quot;txtInfo&quot;</span> <span class="attr">rows</span>=<span class="string">&quot;4&quot;</span> <span class="attr">cols</span>=<span class="string">&quot;20&quot;</span>&gt;</span>1、不爱摄影不懂设计的程序猿不是一个好的产品经理。<span class="tag">&lt;/<span class="name">textarea</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">form</span>&gt;</span></span><br></pre>


<p>效果：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_34.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_34.png"></p>
<p>上图的红框部分表示，我在文本区域进行了换行，所以显示的效果也出现了空白。</p>
<h3 id="表单的语义化"><a href="#表单的语义化" class="headerlink" title="表单的语义化"></a>表单的语义化</h3><p>比如，我们在注册一个网站的信息的时候，有一部分是必填信息，有一部分是选填信息，这个时候可以利用表单的语义化。<br>举例：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">form</span>&gt;</span></span><br><span class="line"></span><br><span class="line">	<span class="tag">&lt;<span class="name">fieldset</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">legend</span>&gt;</span>账号信息<span class="tag">&lt;/<span class="name">legend</span>&gt;</span></span><br><span class="line">	姓名：<span class="tag">&lt;<span class="name">input</span> <span class="attr">value</span>=<span class="string">&quot;呵呵&quot;</span> &gt;</span>逗比<span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line">	密码：<span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;password&quot;</span> <span class="attr">value</span>=<span class="string">&quot;pwd&quot;</span> <span class="attr">size</span>=<span class="string">&quot;50&quot;</span>&gt;</span><span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">fieldset</span>&gt;</span></span><br><span class="line"></span><br><span class="line">	<span class="tag">&lt;<span class="name">fieldset</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">legend</span>&gt;</span>其他信息<span class="tag">&lt;/<span class="name">legend</span>&gt;</span></span><br><span class="line">	性别：<span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;radio&quot;</span> <span class="attr">name</span>=<span class="string">&quot;gender&quot;</span> <span class="attr">value</span>=<span class="string">&quot;male&quot;</span> <span class="attr">checked</span>=<span class="string">&quot;&quot;</span>&gt;</span>男</span><br><span class="line">		  <span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;radio&quot;</span> <span class="attr">name</span>=<span class="string">&quot;gender&quot;</span> <span class="attr">value</span>=<span class="string">&quot;female&quot;</span> &gt;</span>女<span class="tag">&lt;<span class="name">br</span>&gt;</span></span><br><span class="line">	爱好：<span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;checkbox&quot;</span> <span class="attr">name</span>=<span class="string">&quot;love&quot;</span> <span class="attr">value</span>=<span class="string">&quot;eat&quot;</span>&gt;</span>吃饭</span><br><span class="line">		  <span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;checkbox&quot;</span> <span class="attr">name</span>=<span class="string">&quot;love&quot;</span> <span class="attr">value</span>=<span class="string">&quot;sleep&quot;</span>&gt;</span>睡觉</span><br><span class="line">		  <span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;checkbox&quot;</span> <span class="attr">name</span>=<span class="string">&quot;love&quot;</span> <span class="attr">value</span>=<span class="string">&quot;bat&quot;</span>&gt;</span>打豆豆</span><br><span class="line">	<span class="tag">&lt;/<span class="name">fieldset</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;/<span class="name">form</span>&gt;</span></span><br></pre>

<p>效果：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/20151002_36.png" class="lozad post-image"src="http://img.smyhvae.com/20151002_36.png"></p>
<h3 id="lt-label-gt-标签"><a href="#lt-label-gt-标签" class="headerlink" title="&lt;label&gt;标签"></a><code>&lt;label&gt;</code>标签</h3><p>我们先来看下面一段代码：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;radio&quot;</span> <span class="attr">name</span>=<span class="string">&quot;sex&quot;</span> /&gt;</span> 男</span><br><span class="line"><span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;radio&quot;</span> <span class="attr">name</span>=<span class="string">&quot;sex&quot;</span> /&gt;</span> 女</span><br><span class="line"></span><br></pre>

<p>对于上面这样的单选框，我们只有点击那个单选框（小圆圈）才可以选中，点击“男”、“女”这两个文字时是无法选中的；于是，label标签派上了用场。</p>
<p>本质上来讲，“男”、“女”这两个文字和input标签时没有关系的，而label就是解决这个问题的。我们可以通过label把input和汉字包裹起来作为整体。</p>
<p>解决方法如下：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;radio&quot;</span> <span class="attr">name</span>=<span class="string">&quot;sex&quot;</span> <span class="attr">id</span>=<span class="string">&quot;nan&quot;</span> /&gt;</span> <span class="tag">&lt;<span class="name">label</span> <span class="attr">for</span>=<span class="string">&quot;nan&quot;</span>&gt;</span>男<span class="tag">&lt;/<span class="name">label</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;radio&quot;</span> <span class="attr">name</span>=<span class="string">&quot;sex&quot;</span> <span class="attr">id</span>=<span class="string">&quot;nv&quot;</span>  /&gt;</span> <span class="tag">&lt;<span class="name">label</span> <span class="attr">for</span>=<span class="string">&quot;nv&quot;</span>&gt;</span>女<span class="tag">&lt;/<span class="name">label</span>&gt;</span></span><br></pre>

<p>上方代码中，让label标签的<strong>for 属性值</strong>，和 input 标签的 <strong>id 属性值相同</strong>，那么这个label和input就有绑定关系了。</p>
<p>当然了，复选框也有label：（任何表单元素都有label）</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;checkbox&quot;</span> <span class="attr">id</span>=<span class="string">&quot;kk&quot;</span> /&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">label</span> <span class="attr">for</span>=<span class="string">&quot;kk&quot;</span>&gt;</span>10天内免登陆<span class="tag">&lt;/<span class="name">label</span>&gt;</span></span><br></pre>

<h2 id="多媒体标签"><a href="#多媒体标签" class="headerlink" title="多媒体标签"></a>多媒体标签</h2><p><strong>声明：</strong><br>多媒体包含：音频、视频、Flash。网页上的多媒体基本都是Flash格式的。<br>.wmv、.dat、.mob、.rmvb等视频格式，在网页上不能直接播放，需要安装第三方的插件，才可以播放。不同的浏览器，播客上述视频格式，所使用插件参数又不一样。<br>上述格式视频一般文件较大，不利于网络下载播放。<br>一般情况下，是将其它的视频格式，转成Flash来在网页上播放。转换软件：格式工厂等。<br>Flash格式的视频兼容性非常好，Flash格式的文件很小。</p>
<h3 id="lt-bgsound-gt-标签：播放背景音乐"><a href="#lt-bgsound-gt-标签：播放背景音乐" class="headerlink" title="&lt;bgsound&gt;标签：播放背景音乐"></a><code>&lt;bgsound&gt;</code>标签：播放背景音乐</h3><p><strong>属性：</strong></p>
<ul>
<li><code>src=&quot;音乐文件的路径&quot;</code></li>
<li><code>loop=&quot;-1&quot;</code>：属性值代表播放次数，-1代表循环播放。</li>
</ul>
<p>举例：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">body</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">bgsound</span> <span class="attr">src</span>=<span class="string">&quot;王菲 - 清风徐来.mp3&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">bgsound</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></span><br><span class="line"></span><br></pre>
<p>运行效果：<br>打开网页后，在IE 8中播放正常，播放时网页上显示一片空白。在google浏览器中无法播放。</p>
<h3 id="lt-embed-gt-标签：播放多媒体文件（音频、视频等）"><a href="#lt-embed-gt-标签：播放多媒体文件（音频、视频等）" class="headerlink" title="&lt;embed&gt;标签：播放多媒体文件（音频、视频等）"></a><code>&lt;embed&gt;</code>标签：播放多媒体文件（音频、视频等）</h3><p>主要应用Netscape浏览器，它不是W3C规范。</p>
<blockquote>
<p>备注：视频格式可以支持 mp4、wav等，但不是所有视频格式都支持。</p>
</blockquote>
<p><strong>属性：</strong></p>
<ul>
<li><code>src=&quot;多媒体文件的路径&quot;</code></li>
<li><code>loop=&quot;-1&quot;</code>：属性值代表播放次数，-1代表循环播放。</li>
<li><code>autostart=&quot;false&quot;</code>：打开网页时，禁止自动播放。默认值是true。</li>
<li><code>volume=&quot;100&quot;</code>：设置默认的音量大小，测试发现这个值好像不起作用哦。</li>
<li>width：指Flash文件的宽度</li>
<li>height：指Flash文件的高度</li>
<li>quality：指Flash的播放质量，质量有高有低 hight  low</li>
<li>pluginspage：如果指定的Flash插件不存在，则从pluginspage指定的地方进行下载。</li>
<li>type：指定Flash的文件格式类型</li>
<li>wmode：指Flash的背景是否可以透明，取值：transparent是透明的</li>
</ul>
<p><code>&lt;embed&gt;</code>标签播放音频举例：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">body</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">embed</span> <span class="attr">src</span>=<span class="string">&quot;王菲 - 清风徐来.mp3&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">embed</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></span><br><span class="line"></span><br></pre>
<p>IE 8中的运行效果：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_37.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_37.png"></p>
<p>google浏览器中的运行效果：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_38.png" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_38.png"></p>
<p>注：在HTML5中新增了<code>&lt;video&gt;</code>标签播放视频。</p>
<h3 id="lt-object-gt-标签：播放多媒体文件（音频、视频等）"><a href="#lt-object-gt-标签：播放多媒体文件（音频、视频等）" class="headerlink" title="&lt;object&gt;标签：播放多媒体文件（音频、视频等）"></a><code>&lt;object&gt;</code>标签：播放多媒体文件（音频、视频等）</h3><p>主要应用IE浏览器，它是W3C规范。</p>
<p><strong>属性：</strong></p>
<ul>
<li><code>classid</code>：指定Flash插件的ID号，一般存在于注册表中。</li>
<li><code>codebase</code>：如果Flash插件不存在，则从codebase指定的地址下载。</li>
<li><code>&lt;param&gt;</code>标签的主要作用：设置具体的详细参数。</li>
</ul>
<p><strong>总结：在网页中插入Flash时，为了同时兼容多种浏览器，需要将<code>&lt;object&gt;</code>标签和<code>&lt;embed&gt;</code>标签标记一起使用，但使用的顺序是：<code>&lt;object&gt;</code>中嵌套<code>&lt;embed&gt;</code>标记。</strong><br>举例：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">object</span> <span class="attr">classid</span>=<span class="string">&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;</span> <span class="attr">codebase</span>=<span class="string">&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0&quot;</span> <span class="attr">width</span>=<span class="string">&quot;778&quot;</span> <span class="attr">height</span>=<span class="string">&quot;202&quot;</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">param</span> <span class="attr">name</span>=<span class="string">&quot;movie&quot;</span> <span class="attr">value</span>=<span class="string">&quot;images/banner.swf&quot;</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">param</span> <span class="attr">name</span>=<span class="string">&quot;quality&quot;</span> <span class="attr">value</span>=<span class="string">&quot;high&quot;</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">param</span> <span class="attr">name</span>=<span class="string">&quot;wmode&quot;</span> <span class="attr">value</span>=<span class="string">&quot;transparent&quot;</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">embed</span> <span class="attr">src</span>=<span class="string">&quot;images/banner.swf&quot;</span> <span class="attr">width</span>=<span class="string">&quot;778&quot;</span> <span class="attr">height</span>=<span class="string">&quot;202&quot;</span> <span class="attr">quality</span>=<span class="string">&quot;high&quot;</span> <span class="attr">pluginspage</span>=<span class="string">&quot;http://www.macromedia.com/go/getflashplayer&quot;</span> <span class="attr">type</span>=<span class="string">&quot;application/x-shockwave-flash&quot;</span> <span class="attr">wmode</span>=<span class="string">&quot;transparent&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">embed</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">object</span>&gt;</span></span><br></pre>

<h2 id="lt-marquee-gt-：滚动字幕标签"><a href="#lt-marquee-gt-：滚动字幕标签" class="headerlink" title="&lt;marquee&gt;：滚动字幕标签"></a><code>&lt;marquee&gt;</code>：滚动字幕标签</h2><p>如果在这个标签里设置了内容，那么，打开网页时，内容会像弹幕一样自动移动。<br><strong>属性：</strong></p>
<ul>
<li><p><code>direction=&quot;right&quot;</code>：移动的目标方向。属性值可以是：<code>left</code>（从右向左移动，默认值）、<code>right</code>（从左向右移动）、<code>up</code>（从下向上移动）、<code>down</code>（从上向下移动）。</p>
</li>
<li><p><code>behavior=&quot;slide&quot;</code>：行为方式。属性值可以是：<code>slide</code>（只移动一次）、<code>scroll</code>（循环移动，默认值）、<code>alternate</code>（循环移动）、。<br><code>alternate</code>和<code>scroll</code>属性值都是循环移动，区别在于：假设在<code>direction=&quot;right&quot;</code>的情况下，<code>behavior=&quot;scroll&quot;</code>表示从左到右、从左到右、从左到右···<code>behavior=&quot;alternate&quot;</code>表示从左到右、从右到左、从左到右···</p>
</li>
<li><p><code>scrollamount=&quot;30&quot;</code>：移动的速度</p>
</li>
<li><p><code>loop=&quot;3&quot;</code>: 循环多少圈。负值表示无限循环</p>
</li>
<li><p><code>scrolldelay=&quot;1000&quot;</code>：移动一次休息多长时间。单位是毫秒。</p>
</li>
</ul>
<p>举例：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">marquee</span> <span class="attr">behavior</span>=<span class="string">&quot;alternate&quot;</span> <span class="attr">direction</span>=<span class="string">&quot;down&quot;</span>  <span class="attr">width</span>=<span class="string">&quot;300&quot;</span> <span class="attr">height</span>=<span class="string">&quot;200&quot;</span> <span class="attr">bgcolor</span>=<span class="string">&quot;#8c5dc1&quot;</span>&gt;</span>我来了<span class="tag">&lt;/<span class="name">marquee</span>&gt;</span></span><br></pre>

<p>效果：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/2015-10-02-cnblogs_html_04.gif" class="lozad post-image"src="http://img.smyhvae.com/2015-10-02-cnblogs_html_04.gif"></p>
<h2 id="html废弃标签介绍"><a href="#html废弃标签介绍" class="headerlink" title="html废弃标签介绍"></a>html废弃标签介绍</h2><p>HTML现在只负责语义，而不负责样式。但是HTML一开始，连样式也包办了。这些样式的标签，都已经被废弃。</p>
<p>2004年之前的东西：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">font</span> <span class="attr">size</span>=<span class="string">&quot;9&quot;</span> <span class="attr">color</span>=<span class="string">&quot;red&quot;</span>&gt;</span>哈哈<span class="tag">&lt;/<span class="name">font</span>&gt;</span></span><br></pre>

<p>下面这些标签都是css钩子，而不是原意：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">b</span>&gt;</span>加粗<span class="tag">&lt;/<span class="name">b</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">u</span>&gt;</span>下划线<span class="tag">&lt;/<span class="name">u</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">i</span>&gt;</span>倾斜<span class="tag">&lt;/<span class="name">i</span>&gt;</span></span><br><span class="line">   <span class="tag">&lt;<span class="name">del</span>&gt;</span>删除线<span class="tag">&lt;/<span class="name">del</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">em</span>&gt;</span>强调<span class="tag">&lt;/<span class="name">em</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">strong</span>&gt;</span>强调<span class="tag">&lt;/<span class="name">strong</span>&gt;</span></span><br><span class="line"></span><br></pre>

<p>这些标签，是有着浓厚的样式的作用，干涉了css的作用，所以HTML抛弃了他们。</p>
<p>类似的还有水平线标签：</p>
<pre class="highlight"><span class="line"><span class="tag">&lt;<span class="name">hr</span> /&gt;</span></span><br></pre>

<p>换行标签：</p>
<pre class="highlight"><span class="line">&lt;br /&gt;</span><br></pre>

<p>但是，网页中99.9999%需要换行的时候，是因为另起了一个段落，所以要用p，而不要用<code>&lt;br /&gt;</code>。不到万不得已，不要用br标签。</p>
<p>标准的div+css页面，只会用到种类很少的标签：</p>
<pre class="highlight"><span class="line">div  p  h1  span   a   img   ul   ol    dl    input</span><br></pre>

<p>知道每个标签的特殊用法、属性。比如a标签，img的属性。</p>
<h2 id="我的公众号"><a href="#我的公众号" class="headerlink" title="我的公众号"></a>我的公众号</h2><p>想学习<font color=#0000ff><strong>更多技能</strong></font>？不妨关注我的微信公众号（千古壹号id：<code>qianguyihao</code>）。</p>
<p>扫一扫，你将发现另一个全新的世界，而这将是一场美丽的意外：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/cnblogs/%E7%94%9F%E5%91%BD%E5%9B%A2%E9%98%9F%E5%85%AC%E4%BC%97%E5%8F%B7%E4%BA%8C%E7%BB%B4%E7%A0%81.jpg" class="lozad post-image"src="http://img.smyhvae.com/cnblogs/%E7%94%9F%E5%91%BD%E5%9B%A2%E9%98%9F%E5%85%AC%E4%BC%97%E5%8F%B7%E4%BA%8C%E7%BB%B4%E7%A0%81.jpg"></p>

  </div>
  <div>
    
      <div 
        class="post-note note-warning copyright" 
        style="margin-top: 42px">
        <p>
          <span style="font-weight: bold;">作者：</span><a 
            target="_blank" 
            rel="nofollow noopener noreferrer" 
            href="/about">
            zwl5670
          </a>
        </p>
        <p>
          <span style="font-weight: bold;">文章链接：</span><a 
            target="_blank" 
            rel="nofollow noopener noreferrer" 
            href="https://zwl5670.gitee.io/2001/01/01/01-HTML/07-html%E6%A0%87%E7%AD%BE%E5%9B%BE%E6%96%87%E8%AF%A6%E8%A7%A3%EF%BC%88%E4%BA%8C%EF%BC%89/">
            https://zwl5670.gitee.io/2001/01/01/01-HTML/07-html%E6%A0%87%E7%AD%BE%E5%9B%BE%E6%96%87%E8%AF%A6%E8%A7%A3%EF%BC%88%E4%BA%8C%EF%BC%89/
          </a>
        </p>
        <p><span style="font-weight: bold;">版权声明：</span>本博客所有文章除特别声明外，均采用<a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0 协议</a>。转载请注明出处！</p>
      </div>
    
  </div>
</article>
<div class="nav">
  
    <div class="nav-item-prev">
      <a 
        href="/2001/01/01/01-HTML/09-HTML5%E4%B8%BE%E4%BE%8B%EF%BC%9A%E7%AE%80%E5%8D%95%E7%9A%84%E8%A7%86%E9%A2%91%E6%92%AD%E6%94%BE%E5%99%A8/" 
        class="nav-link">
        <i class="iconfont icon-left nav-prev-icon"></i>
        <div>
          <div class="nav-label">上一篇</div>
          
            <div class="nav-title">09-HTML5举例：简单的视频播放器 </div>
          
        </div>
      </a>
    </div>
  
  
    <div class="nav-item-next">
      <a 
        href="/2001/01/01/01-HTML/10-HTML5%E8%AF%A6%E8%A7%A3%EF%BC%88%E4%BA%8C%EF%BC%89/" 
        class="nav-link">
        <div>
          <div class="nav-label">下一篇</div>
          
            <div class="nav-title">10-HTML5详解（二） </div>
          
        </div>
        <i class="iconfont icon-right nav-next-icon"></i>
      </a>
    </div>
  
</div>

<div 
  class="card card-content toc-card" 
  id="mobiletoc">
  <div class="toc-header">
  <i 
    class="iconfont icon-menu" 
    style="padding-right: 2px;">
  </i>目录
</div>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%9C%AC%E6%96%87%E4%B8%BB%E8%A6%81%E5%86%85%E5%AE%B9"><span class="toc-text">本文主要内容</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%88%97%E8%A1%A8%E6%A0%87%E7%AD%BE"><span class="toc-text">列表标签</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1%E3%80%81%E6%97%A0%E5%BA%8F%E5%88%97%E8%A1%A8-lt-ul-gt-%EF%BC%8C%E6%97%A0%E5%BA%8F%E5%88%97%E8%A1%A8%E4%B8%AD%E7%9A%84%E6%AF%8F%E4%B8%80%E9%A1%B9%E6%98%AF-lt-li-gt"><span class="toc-text">1、无序列表&lt;ul&gt;，无序列表中的每一项是&lt;li&gt;</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#ul%E6%A0%87%E7%AD%BE%E5%AE%9E%E9%99%85%E5%BA%94%E7%94%A8%E5%9C%BA%E6%99%AF%EF%BC%9A"><span class="toc-text">ul标签实际应用场景：</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2%E3%80%81%E6%9C%89%E5%BA%8F%E5%88%97%E8%A1%A8-lt-ol-gt-%EF%BC%8C%E9%87%8C%E9%9D%A2%E7%9A%84%E6%AF%8F%E4%B8%80%E9%A1%B9%E6%98%AF-lt-li-gt"><span class="toc-text">2、有序列表&lt;ol&gt;，里面的每一项是&lt;li&gt;</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3%E3%80%81%E5%AE%9A%E4%B9%89%E5%88%97%E8%A1%A8-lt-dl-gt"><span class="toc-text">3、定义列表&lt;dl&gt;</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%A1%A8%E6%A0%BC%E6%A0%87%E7%AD%BE"><span class="toc-text">表格标签</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-tr-gt-%EF%BC%9A%E8%A1%8C"><span class="toc-text">&lt;tr&gt;：行</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-td-gt-%EF%BC%9A%E5%8D%95%E5%85%83%E6%A0%BC"><span class="toc-text">&lt;td&gt;：单元格</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8D%95%E5%85%83%E6%A0%BC%E7%9A%84%E5%90%88%E5%B9%B6"><span class="toc-text">单元格的合并</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-th-gt-%EF%BC%9A%E5%8A%A0%E7%B2%97%E7%9A%84%E5%8D%95%E5%85%83%E6%A0%BC%E3%80%82%E7%9B%B8%E5%BD%93%E4%BA%8E-lt-td-gt-lt-b-gt"><span class="toc-text">&lt;th&gt;：加粗的单元格。相当于&lt;td&gt; + &lt;b&gt;</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-caption-gt-%EF%BC%9A%E8%A1%A8%E6%A0%BC%E7%9A%84%E6%A0%87%E9%A2%98%E3%80%82%E4%BD%BF%E7%94%A8%E6%97%B6%E5%92%8Ctr%E6%A0%87%E7%AD%BE%E5%B9%B6%E5%88%97"><span class="toc-text">&lt;caption&gt;：表格的标题。使用时和tr标签并列</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%A1%A8%E6%A0%BC%E7%9A%84-lt-thead-gt-%E6%A0%87%E7%AD%BE%E3%80%81-lt-tbody-gt-%E6%A0%87%E7%AD%BE%E3%80%81-lt-tfoot-gt-%E6%A0%87%E7%AD%BE"><span class="toc-text">表格的&lt;thead&gt;标签、&lt;tbody&gt;标签、&lt;tfoot&gt;标签</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%A1%86%E6%9E%B6%E6%A0%87%E7%AD%BE"><span class="toc-text">框架标签</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-frameset-gt-%EF%BC%9A%E6%A1%86%E6%9E%B6%E7%9A%84%E9%9B%86%E5%90%88"><span class="toc-text">&lt;frameset&gt;：框架的集合</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-frame-gt-%EF%BC%9A%E6%A1%86%E6%9E%B6"><span class="toc-text">&lt;frame&gt;：框架</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%86%85%E5%B5%8C%E6%A1%86%E6%9E%B6"><span class="toc-text">内嵌框架</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%A1%A8%E5%8D%95%E6%A0%87%E7%AD%BE"><span class="toc-text">表单标签</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-input-gt-%EF%BC%9A%E8%BE%93%E5%85%A5%E6%A0%87%E7%AD%BE%EF%BC%88%E6%96%87%E6%9C%AC%E6%A1%86%EF%BC%89"><span class="toc-text">&lt;input&gt;：输入标签（文本框）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-select-gt-%EF%BC%9A%E4%B8%8B%E6%8B%89%E5%88%97%E8%A1%A8%E6%A0%87%E7%AD%BE"><span class="toc-text">&lt;select&gt;：下拉列表标签</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-textarea-gt-%E6%A0%87%E7%AD%BE%EF%BC%9A%E5%A4%9A%E8%A1%8C%E6%96%87%E6%9C%AC%E8%BE%93%E5%85%A5%E6%A1%86"><span class="toc-text">&lt;textarea&gt;标签：多行文本输入框</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%A1%A8%E5%8D%95%E7%9A%84%E8%AF%AD%E4%B9%89%E5%8C%96"><span class="toc-text">表单的语义化</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-label-gt-%E6%A0%87%E7%AD%BE"><span class="toc-text">&lt;label&gt;标签</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%A4%9A%E5%AA%92%E4%BD%93%E6%A0%87%E7%AD%BE"><span class="toc-text">多媒体标签</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-bgsound-gt-%E6%A0%87%E7%AD%BE%EF%BC%9A%E6%92%AD%E6%94%BE%E8%83%8C%E6%99%AF%E9%9F%B3%E4%B9%90"><span class="toc-text">&lt;bgsound&gt;标签：播放背景音乐</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-embed-gt-%E6%A0%87%E7%AD%BE%EF%BC%9A%E6%92%AD%E6%94%BE%E5%A4%9A%E5%AA%92%E4%BD%93%E6%96%87%E4%BB%B6%EF%BC%88%E9%9F%B3%E9%A2%91%E3%80%81%E8%A7%86%E9%A2%91%E7%AD%89%EF%BC%89"><span class="toc-text">&lt;embed&gt;标签：播放多媒体文件（音频、视频等）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-object-gt-%E6%A0%87%E7%AD%BE%EF%BC%9A%E6%92%AD%E6%94%BE%E5%A4%9A%E5%AA%92%E4%BD%93%E6%96%87%E4%BB%B6%EF%BC%88%E9%9F%B3%E9%A2%91%E3%80%81%E8%A7%86%E9%A2%91%E7%AD%89%EF%BC%89"><span class="toc-text">&lt;object&gt;标签：播放多媒体文件（音频、视频等）</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#lt-marquee-gt-%EF%BC%9A%E6%BB%9A%E5%8A%A8%E5%AD%97%E5%B9%95%E6%A0%87%E7%AD%BE"><span class="toc-text">&lt;marquee&gt;：滚动字幕标签</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#html%E5%BA%9F%E5%BC%83%E6%A0%87%E7%AD%BE%E4%BB%8B%E7%BB%8D"><span class="toc-text">html废弃标签介绍</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%88%91%E7%9A%84%E5%85%AC%E4%BC%97%E5%8F%B7"><span class="toc-text">我的公众号</span></a></li></ol>
</div>
            </main>
            <aside class="right-column">
              <div class="sticky-widescreen">
  
  
    <article class="card card-content toc-card">
      <div class="toc-header">
  <i 
    class="iconfont icon-menu" 
    style="padding-right: 2px;">
  </i>目录
</div>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%9C%AC%E6%96%87%E4%B8%BB%E8%A6%81%E5%86%85%E5%AE%B9"><span class="toc-text">本文主要内容</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%88%97%E8%A1%A8%E6%A0%87%E7%AD%BE"><span class="toc-text">列表标签</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1%E3%80%81%E6%97%A0%E5%BA%8F%E5%88%97%E8%A1%A8-lt-ul-gt-%EF%BC%8C%E6%97%A0%E5%BA%8F%E5%88%97%E8%A1%A8%E4%B8%AD%E7%9A%84%E6%AF%8F%E4%B8%80%E9%A1%B9%E6%98%AF-lt-li-gt"><span class="toc-text">1、无序列表&lt;ul&gt;，无序列表中的每一项是&lt;li&gt;</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#ul%E6%A0%87%E7%AD%BE%E5%AE%9E%E9%99%85%E5%BA%94%E7%94%A8%E5%9C%BA%E6%99%AF%EF%BC%9A"><span class="toc-text">ul标签实际应用场景：</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2%E3%80%81%E6%9C%89%E5%BA%8F%E5%88%97%E8%A1%A8-lt-ol-gt-%EF%BC%8C%E9%87%8C%E9%9D%A2%E7%9A%84%E6%AF%8F%E4%B8%80%E9%A1%B9%E6%98%AF-lt-li-gt"><span class="toc-text">2、有序列表&lt;ol&gt;，里面的每一项是&lt;li&gt;</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3%E3%80%81%E5%AE%9A%E4%B9%89%E5%88%97%E8%A1%A8-lt-dl-gt"><span class="toc-text">3、定义列表&lt;dl&gt;</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%A1%A8%E6%A0%BC%E6%A0%87%E7%AD%BE"><span class="toc-text">表格标签</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-tr-gt-%EF%BC%9A%E8%A1%8C"><span class="toc-text">&lt;tr&gt;：行</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-td-gt-%EF%BC%9A%E5%8D%95%E5%85%83%E6%A0%BC"><span class="toc-text">&lt;td&gt;：单元格</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8D%95%E5%85%83%E6%A0%BC%E7%9A%84%E5%90%88%E5%B9%B6"><span class="toc-text">单元格的合并</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-th-gt-%EF%BC%9A%E5%8A%A0%E7%B2%97%E7%9A%84%E5%8D%95%E5%85%83%E6%A0%BC%E3%80%82%E7%9B%B8%E5%BD%93%E4%BA%8E-lt-td-gt-lt-b-gt"><span class="toc-text">&lt;th&gt;：加粗的单元格。相当于&lt;td&gt; + &lt;b&gt;</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-caption-gt-%EF%BC%9A%E8%A1%A8%E6%A0%BC%E7%9A%84%E6%A0%87%E9%A2%98%E3%80%82%E4%BD%BF%E7%94%A8%E6%97%B6%E5%92%8Ctr%E6%A0%87%E7%AD%BE%E5%B9%B6%E5%88%97"><span class="toc-text">&lt;caption&gt;：表格的标题。使用时和tr标签并列</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%A1%A8%E6%A0%BC%E7%9A%84-lt-thead-gt-%E6%A0%87%E7%AD%BE%E3%80%81-lt-tbody-gt-%E6%A0%87%E7%AD%BE%E3%80%81-lt-tfoot-gt-%E6%A0%87%E7%AD%BE"><span class="toc-text">表格的&lt;thead&gt;标签、&lt;tbody&gt;标签、&lt;tfoot&gt;标签</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%A1%86%E6%9E%B6%E6%A0%87%E7%AD%BE"><span class="toc-text">框架标签</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-frameset-gt-%EF%BC%9A%E6%A1%86%E6%9E%B6%E7%9A%84%E9%9B%86%E5%90%88"><span class="toc-text">&lt;frameset&gt;：框架的集合</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-frame-gt-%EF%BC%9A%E6%A1%86%E6%9E%B6"><span class="toc-text">&lt;frame&gt;：框架</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%86%85%E5%B5%8C%E6%A1%86%E6%9E%B6"><span class="toc-text">内嵌框架</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%A1%A8%E5%8D%95%E6%A0%87%E7%AD%BE"><span class="toc-text">表单标签</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-input-gt-%EF%BC%9A%E8%BE%93%E5%85%A5%E6%A0%87%E7%AD%BE%EF%BC%88%E6%96%87%E6%9C%AC%E6%A1%86%EF%BC%89"><span class="toc-text">&lt;input&gt;：输入标签（文本框）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-select-gt-%EF%BC%9A%E4%B8%8B%E6%8B%89%E5%88%97%E8%A1%A8%E6%A0%87%E7%AD%BE"><span class="toc-text">&lt;select&gt;：下拉列表标签</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-textarea-gt-%E6%A0%87%E7%AD%BE%EF%BC%9A%E5%A4%9A%E8%A1%8C%E6%96%87%E6%9C%AC%E8%BE%93%E5%85%A5%E6%A1%86"><span class="toc-text">&lt;textarea&gt;标签：多行文本输入框</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%A1%A8%E5%8D%95%E7%9A%84%E8%AF%AD%E4%B9%89%E5%8C%96"><span class="toc-text">表单的语义化</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-label-gt-%E6%A0%87%E7%AD%BE"><span class="toc-text">&lt;label&gt;标签</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%A4%9A%E5%AA%92%E4%BD%93%E6%A0%87%E7%AD%BE"><span class="toc-text">多媒体标签</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-bgsound-gt-%E6%A0%87%E7%AD%BE%EF%BC%9A%E6%92%AD%E6%94%BE%E8%83%8C%E6%99%AF%E9%9F%B3%E4%B9%90"><span class="toc-text">&lt;bgsound&gt;标签：播放背景音乐</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-embed-gt-%E6%A0%87%E7%AD%BE%EF%BC%9A%E6%92%AD%E6%94%BE%E5%A4%9A%E5%AA%92%E4%BD%93%E6%96%87%E4%BB%B6%EF%BC%88%E9%9F%B3%E9%A2%91%E3%80%81%E8%A7%86%E9%A2%91%E7%AD%89%EF%BC%89"><span class="toc-text">&lt;embed&gt;标签：播放多媒体文件（音频、视频等）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#lt-object-gt-%E6%A0%87%E7%AD%BE%EF%BC%9A%E6%92%AD%E6%94%BE%E5%A4%9A%E5%AA%92%E4%BD%93%E6%96%87%E4%BB%B6%EF%BC%88%E9%9F%B3%E9%A2%91%E3%80%81%E8%A7%86%E9%A2%91%E7%AD%89%EF%BC%89"><span class="toc-text">&lt;object&gt;标签：播放多媒体文件（音频、视频等）</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#lt-marquee-gt-%EF%BC%9A%E6%BB%9A%E5%8A%A8%E5%AD%97%E5%B9%95%E6%A0%87%E7%AD%BE"><span class="toc-text">&lt;marquee&gt;：滚动字幕标签</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#html%E5%BA%9F%E5%BC%83%E6%A0%87%E7%AD%BE%E4%BB%8B%E7%BB%8D"><span class="toc-text">html废弃标签介绍</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%88%91%E7%9A%84%E5%85%AC%E4%BC%97%E5%8F%B7"><span class="toc-text">我的公众号</span></a></li></ol>
    </article>
  
  
  <article class="card card-content">
    <div class="recent-posts-card">
  <div class="recent-posts-header">
    <i 
      class="iconfont icon-wenzhang_huaban" 
      style="padding-right: 2px;">
    </i>最近文章
  </div>
  <div class="recent-posts-list">
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2023-03-09</div>
        <a href="/2023/03/09/13-React%E5%9F%BA%E7%A1%80/11-React%20Navive%E5%88%9D%E8%AF%86/"><div class="recent-posts-item-content">11-React Navive初识</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2023-03-09</div>
        <a href="/2023/03/09/13-React%E5%9F%BA%E7%A1%80/10-AntD%E6%A1%86%E6%9E%B6%E7%9A%84upload%E7%BB%84%E4%BB%B6%E4%B8%8A%E4%BC%A0%E5%9B%BE%E7%89%87%E6%97%B6%E4%BD%BF%E7%94%A8customRequest%E6%96%B9%E6%B3%95%E8%87%AA%E5%AE%9A%E4%B9%89%E4%B8%8A%E4%BC%A0%E8%A1%8C%E4%B8%BA/"><div class="recent-posts-item-content">10-AntD框架的upload组件上传图片时使用customRequest方法自定义上传行为</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2023-03-09</div>
        <a href="/2023/03/09/13-React%E5%9F%BA%E7%A1%80/09-AntD%E6%A1%86%E6%9E%B6%E7%9A%84upload%E7%BB%84%E4%BB%B6%E4%B8%8A%E4%BC%A0%E5%9B%BE%E7%89%87%E6%97%B6%E9%81%87%E5%88%B0%E7%9A%84%E4%B8%80%E4%BA%9B%E5%9D%91/"><div class="recent-posts-item-content">09-AntD框架的upload组件上传图片时遇到的一些坑</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2023-03-09</div>
        <a href="/2023/03/09/13-React%E5%9F%BA%E7%A1%80/08-Ant%20Design%E7%9A%84%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8/"><div class="recent-posts-item-content">08-Ant Design的基本使用</div></a>
      </div>
    
  </div>
</div>
  </article>
  
  
</div>
            </aside>
          </div>
        </div>
      </div>
    </div>
     
    <footer class="footer">
  <div class="footer-container">
    <div>
      <div class="footer-dsc">
        <span>
          Copyright ©
          
            2023
          
          
        </span>
        &nbsp;
        <a 
          href="/" 
          class="footer-link">
          前端面试
        </a>
      </div>
    </div>

    
      <div class="footer-dsc">
        
          Powered by
          <a 
            href="https://hexo.io/" 
            class="footer-link" 
            target="_blank" 
            rel="nofollow noopener noreferrer">
            &nbsp;Hexo
          </a>
        
        
          <span>&nbsp;|&nbsp;</span>
        
        
          Theme -
          <a 
            href="https://github.com/theme-kaze" 
            class="footer-link" 
            target="_blank"
            rel="nofollow noopener noreferrer">
            &nbsp;Kaze
          </a>
        
      </div>
    
    
    
    
</footer>
 
    
  <a 
    role="button" 
    id="scrollbutton" 
    class="basebutton" 
    aria-label="回到顶部">
    <i class="iconfont icon-arrowleft button-icon"></i>
  </a>

<a 
  role="button" 
  id="menubutton"
  aria-label="menu button"
  class="basebutton">
  <i class="iconfont icon-menu button-icon"></i>
</a>
<a 
  role="button" 
  id="popbutton" 
  class="basebutton" 
  aria-label="控制中心">
  <i class="iconfont icon-expand button-icon"></i>
</a>
<a 
  role="button" 
  id="darkbutton" 
  class="basebutton darkwidget" 
  aria-label="夜色模式">
  <i class="iconfont icon-weather button-icon"></i>
</a>
<a 
  role="button" 
  id="searchbutton" 
  class="basebutton searchwidget" 
  aria-label="搜索">
  <i class="iconfont icon-search button-icon"></i>
</a> 
     
     
     
      <script>
  var addImgLayout = function () {
    var img = document.querySelectorAll('.post-content img')
    var i
    for (i = 0; i < img.length; i++) {
      var wrapper = document.createElement('a')
      wrapper.setAttribute('href', img[i].getAttribute('data-src'))
      wrapper.setAttribute('aria-label', 'illustration')
      wrapper.style.cssText =
        'width: 100%; display: flex; justify-content: center;'
      if (img[i].alt) wrapper.dataset.caption = img[i].alt
      wrapper.dataset.nolink = true
      img[i].before(wrapper)
      wrapper.append(img[i])
      var divWrap = document.createElement('div')
      divWrap.classList.add('gallery')
      wrapper.before(divWrap)
      divWrap.append(wrapper)
    }
    baguetteBox.run('.gallery')
  }
</script>
<script>
  loadScript(
    "/js/lib/lightbox/baguetteBox.min.js",
    addImgLayout
  )
</script>
 
     
     
    <script src="/js/main.js"></script> 
     
    
      <script>
        var addLazyload = function () {
          var observer = lozad('.lozad', {
            load: function (el) {
              el.srcset = el.getAttribute('data-src')
            },
            loaded: function (el) {
              el.classList.add('loaded')
            },
          })
          observer.observe()
        }
      </script>
      <script>
        loadScript('/js/lib/lozad.min.js', addLazyload)
      </script>
    
    <script src="//instant.page/5.1.0" type="module"
      integrity="sha384-by67kQnR+pyfy8yWP4kPO12fHKRLHZPfEsiSXR8u2IKcTdxD805MGUXBzVPnkLHw"></script>
    
    
  </body>
</html>
